I was looking at ObjectMapper libary. And noticed the <-
operator.
How does this exactly work ?
// Mappable
func mapping(map: Map) {
username <- map["username"]
age <- map["age"]
weight <- map["weight"]
array <- map["arr"]
dictionary <- map["dict"]
bestFriend <- map["best_friend"]
friends <- map["friends"]
birthday <- (map["birthday"], DateTransform())
}
Also how does the following line work
birthday <- (map["birthday"], DateTransform())
I understand that birthday
is now a tuple. Which can be access by
self.birthday.0
self.birthday.1
Although the property is defined like so
var birthday: NSDate?
How does a tuple respond as a NSDate
(in this case) ?
Thanks!