Swift snippet #7 — Optional?
Wednesday, 7th December, 2016
The above snippet creates a
not property on an optional variable which in case of a bool return its opposite value and otherwise it returns a false. You can relate this with my last snippet — swift-snippet#6.
I’ll share a code sample to show it usage..
It saves us from unnecessary
guard-lets to perform a simple reversal of a boolean value 🚀
If you are wondering about the inception of Swift-Snippets or want to checkout more such snippets then you can find them here 😊