class PersonEntry: NSObject {
var firstName: String?
var lastName: String?
}
//This errors
if (self.person.firstName?.isEmpty) {
println("Empty")
}
//Compiler auto-correction is this
if ((self.model.firstName?.isEmpty) != nil) {
println("Empty")
}
I understand that optional chaining returns an optional type. So I suppose my question is, how do you unwrap an optional string, to inspect it's length, without risking a crash ?