Closed iTofu closed 7 years ago
Sometimes we needn't return value, like this:
UINavigationBar.appearance().then({ $0.tintColor = .white $0.barTintColor = .ggTint $0.isTranslucent = true $0.titleTextAttributes = [ NSFontAttributeName: UIFont.systemFont(ofSize: 18.0), NSForegroundColorAttributeName: UIColor.white ] })
No @discardableResult will give us a warning says:
@discardableResult
Result of call to 'then' is unused
So what we should to do is just add @discardableResult :)
In this case you can use do() instead.
do()
Woo, yes, thank you!
Sometimes we needn't return value, like this:
No
@discardableResult
will give us a warning says:So what we should to do is just add
@discardableResult
:)