Check to see if empty or nil

suggest change

Swift

if let text = self.textView.text where !text.isEmpty {
    // Do stuff for text
} else {
    // Do stuff for nil text or empty string
}

Objective-C

if (self.textView.text.length > 0){
    // Do stuff for text
}   else {
    // Do stuff for nil text or empty string
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents