檢查是否為空或零
迅速
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
}