Hi there,
I'm trying to map a NSDate, like this:
...
var date : NSDate?
...
func mapping(map: Map) {
date <- (map["date"], DateTransform())
}
But it fails and I'm left with:
Binary operator '<-' cannot be applied to operands of type 'NSDate?' and '(map, DateTransform)'
@Dbigshooter, if you're using Swift 3, you should use Date
instead of NSDate
.
@devxoul Just changed it, compiles now, but still leaves null in my object date property.
@Dbigshooter please provide us the JSON dictionary
Got this solved, using Date() instead of NSDate did it, thanks!
Most helpful comment
Got this solved, using Date() instead of NSDate did it, thanks!