• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Builder categories for some foundation classes

jbw-builders

Builder categories for NSURL and NSDate. The builder category adds a builder pattern based convenience initializer to easily build these classes. Instead of creating a custom builder object, the build in foundation NS*Components objects are used.

By Joris Kluivers

Example

NSDate *testDate = [NSDate gregorianDateWithBuilderBlock:^(NSDateComponents *builder) {
    builder.year = 2014;
    builder.month = 4;
    builder.day = 8;
    builder.hour = 12;
}];

NSURL *testURL = [NSURL URLWithBuilderBlock:^(NSURLComponents *builder) {
    builder.host = @"joris.kluivers.nl";
    builder.scheme = @"http";
}];