Is there a way to check strings for nil and \"\" in Swift? In Rails, I can use blank() to check.
nil
\"\"
blank()
I currently have this, but i
I would recommend.
if stringA.map(isEmpty) == false { println("blah blah") }
map applies the function argument if the optional is .Some. The playground capture also shows another possibility with the new Swift 1.2 if let optional binding.
map
.Some