Builder categories for some foundation classes
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Builders
.gitignore
LICENSE
NSDate+JBWBuilders.h
NSDate+JBWBuilders.m
NSURL+JBWBuilders.h
NSURL+JBWBuilders.m
README.md
jbw-builders.podspec

README.md

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";
}];