Skip to content

Instantly share code, notes, and snippets.

@dhiraj-das
Created May 2, 2017 17:23
Show Gist options
  • Save dhiraj-das/f841afd5417f9f1499c8589a55c7108a to your computer and use it in GitHub Desktop.
Save dhiraj-das/f841afd5417f9f1499c8589a55c7108a to your computer and use it in GitHub Desktop.
Builder Design Pattern in Swift
var myHouse: House? = nil
myHouse = HouseBuilder(noOfRooms: 2)
.set(color: .red)
.addBalcony()
.set(noOfBathrooms: 3)
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment