Hey I am having a problem trying to convert this old code into swift 3:
func textViewDidChange(textView: UITextView) {
let components = self.txtBody.text.componentsSeparatedByString(" \n")
self.navigationItem.title = ""
for item in components {
if countElements(item.trimmingCharacters(in: NSCharacterSet.whitespacesAndNewlines())) > 0 {
self.navigationItem.title = item
break
}
}
}
The problem is the countElements is not correct as it is not recognised in Swift. I am unsure how to convert it to swift 3
Any help or guidance would be great thanks
Harraj