Created
June 21, 2020 16:13
-
-
Save PatrikTheDev/0689d786e6cbf68fa66b8ac9888cf4b6 to your computer and use it in GitHub Desktop.
configure vs self-executing closure
This file contains hidden or 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
// BAD | |
let idgaf: UILabel = { | |
let label = UILabel() | |
label.text = "huh" | |
return label | |
}() | |
// GOOD | |
let disIsGood = configure(UILabel() { | |
$0.text = "YAAY" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment