let allPlaces = resultsArray.map({ (param) -> Places in
return Places(dictionary: param )
})
print("All Places \(allPlaces[0].placeName)")
The output of the above code is:
All Places Optional("Subway")
In the below code the var is not optional. But the print statement prints it as Optional. Should it not print All Places "Subway"?
class Places: NSObject {
var name:String!
init(dictionary:Dictionary<String, Any>) {
name = dictionary["name"] as? String
}
}