Skip to content

Instantly share code, notes, and snippets.

@dhiraj-das
Created May 2, 2017 17:19
Show Gist options
  • Save dhiraj-das/5dd1919561318a41b309c8713e9efd34 to your computer and use it in GitHub Desktop.
Save dhiraj-das/5dd1919561318a41b309c8713e9efd34 to your computer and use it in GitHub Desktop.
Builder Design Pattern in Swift
class House {
var color: UIColor
var noOfRooms: Int
var noOfBathrooms: Int
var hasBalcony: Bool
init(builder: HouseBuilder)
{
color = builder.color
noOfRooms = builder.noOfRooms
noOfBathrooms = builder.noOfBathrooms
hasBalcony = builder.hasBalcony
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment