Created
April 8, 2014 13:22
-
-
Save kluivers/10123376 to your computer and use it in GitHub Desktop.
Builder pattern in Objective-C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSURL *someURL = [NSURL URLWithBuilderBlock:^(NSURLComponents *builder) { | |
builder.scheme = @"http"; | |
builder.host = @"joris.kluivers.nl"; | |
builder.path = @"/blog/2013/10/17/nsurlcomponents/"; | |
}]; | |
// url now equals: | |
// http://joris.kluivers.nl/blog/2013/10/17/nsurlcomponents/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment