This file contains 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
/** | |
Describes a Model that can be built by a Builder | |
*/ | |
protocol BuildableModel { | |
} | |
/** | |
Describes a Builder. Extends `class` so that set() calls can return self without the compiler complaining about an immutable value. This is for chaining set() and build() calls. | |
*/ | |
protocol Builder: class { |
This file contains 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
struct UserSignUp { | |
var firstName: String | |
var lastName: String? | |
var username: String | |
var password: String | |
class Builder { | |
var firstName: String? | |
var lastName: String? | |
var username: String? |