I am attempting to use count
on a String.
var items = String()
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count // Error: 'count' is unavailable
}
This gives the error:
Error: 'count' is unavailable: there is no universally good answer, see the documentation comment for discussion
Why is count
unavailable? Why is there no "universally good answer"? How can I get the number of items in the String?