I\'m trying to add usernames from Parse in an array to display them in a UITableView, but get an error when I\'m appending the usernames to my array.
The error I get is:
I solved my problem. I declare the array as an empty array and for unwrap the optional with the following code:
var usernames = [String]()
self.usernames.removeAll(keepCapacity: true)
for fetchedUser in fetchedUsers! {
if let username = fetchedUser.username as String! {
self.usernames.append(username)
}
}