Created
July 18, 2015 21:35
-
-
Save andr-ggn/31cea69456e51467f06a to your computer and use it in GitHub Desktop.
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
1). ------------------------------------------------------------- | |
lazy var validator: Validator = { [unowned self] in | |
let validator = Validator() | |
validator.setSomething = "Foo" | |
validator.setSomethingMore = "Bar" | |
return validator | |
}() | |
2). ------------------------------------------------------------- | |
var validator: Validator { | |
let validator = Validator() | |
validator.setSomething = "Foo" | |
validator.setSomethingMore = "Bar" | |
return validator | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment