If I declared a String this way: var date = String()
and I want to check my nil String weather or not, so I'm trying something like:
if date != nil{ println("It not nil") }
But I got an error like: Can not invoke '!=' with an argument list of type '(@lvalue String, NilLiteralConvertible)'
after that i try this:
if let date1 = date{ println("It not nil") }
But still I get an error like: Bound value in a conditional binding must be of Optional type
So my question is: how can I verify that String not nil if I declare it this way ?
source share