Skip to content

Instantly share code, notes, and snippets.

@qmchenry
Created September 17, 2016 18:53
Show Gist options
  • Save qmchenry/943cee58ec81061b1f8af07d64dc6f99 to your computer and use it in GitHub Desktop.
Save qmchenry/943cee58ec81061b1f8af07d64dc6f99 to your computer and use it in GitHub Desktop.
Then and now
// with Then
let label = UILabel().then {
$0.textAlignment = .center
$0.textColor = .black
$0.text = "Hello, World!"
}
// just Swift
let label: UILabel() = {
$0.textAlignment = .center
$0.textColor = .black
$0.text = "Hello, World!"
}(UILabel())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment