{"action":"created","issue":{"url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/117","labels_url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/117/comments","events_url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/117/events","html_url":"https://github.com/EasyMapping/EasyMapping/issues/117","id":112610820,"number":117,"title":"reverse mapping of date not working","user":{"login":"szehnder","id":408456,"avatar_url":"https://avatars.githubusercontent.com/u/408456?v=3","gravatar_id":"","url":"https://api.github.com/users/szehnder","html_url":"https://github.com/szehnder","followers_url":"https://api.github.com/users/szehnder/followers","following_url":"https://api.github.com/users/szehnder/following{/other_user}","gists_url":"https://api.github.com/users/szehnder/gists{/gist_id}","starred_url":"https://api.github.com/users/szehnder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szehnder/subscriptions","organizations_url":"https://api.github.com/users/szehnder/orgs","repos_url":"https://api.github.com/users/szehnder/repos","events_url":"https://api.github.com/users/szehnder/events{/privacy}","received_events_url":"https://api.github.com/users/szehnder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"DenHeadless","id":853604,"avatar_url":"https://avatars.githubusercontent.com/u/853604?v=3","gravatar_id":"","url":"https://api.github.com/users/DenHeadless","html_url":"https://github.com/DenHeadless","followers_url":"https://api.github.com/users/DenHeadless/followers","following_url":"https://api.github.com/users/DenHeadless/following{/other_user}","gists_url":"https://api.github.com/users/DenHeadless/gists{/gist_id}","starred_url":"https://api.github.com/users/DenHeadless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenHeadless/subscriptions","organizations_url":"https://api.github.com/users/DenHeadless/orgs","repos_url":"https://api.github.com/users/DenHeadless/repos","events_url":"https://api.github.com/users/DenHeadless/events{/privacy}","received_events_url":"https://api.github.com/users/DenHeadless/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-10-21T15:06:45Z","updated_at":"2015-10-21T21:32:23Z","closed_at":null,"body":"using v. 0.15.3, neither of the following mappings seem to work when using EKSerializer to create NSDictionary from an entity:\r\n\r\n```Swift\r\n        mapping.mapKeyPath(\"timestamp\", toProperty: \"evvTimestamp\", withValueBlock: { (str:String!, obj:AnyObject!, context:NSManagedObjectContext!) -> AnyObject! in\r\n                return NSDateFormatter.isoFormatter().dateFromString(str)\r\n        }) { (obj:AnyObject!, context:NSManagedObjectContext!) -> AnyObject! in\r\n            let str = NSDateFormatter.isoFormatter().stringFromDate(obj as! NSDate) as String\r\n            return str\r\n        }\r\n```\r\nI've also tried the following:\r\n```Swift\r\nmapping.mapKeyPath(\"timestamp\", toProperty:\"evvTimestamp\", withDateFormatter: NSDateFormatter.isoFormatter())\r\n```\r\nThat formatter looks like so:\r\n```Swift\r\nextension NSDateFormatter {\r\n    \r\n    class func isoFormatter() -> NSDateFormatter {\r\n        let formatter = NSDateFormatter()\r\n        formatter.dateFormat = \"yyyy-MM-dd'T'HH:mm:ssZZZ\"\r\n        return formatter\r\n    }\r\n}\r\n```\r\n\r\nHere's how I'm trying to serialize it:\r\n```Swift\r\n        var payload = EKSerializer.serializeObject(request, withMapping: mapping)\r\n```\r\nWhen I do so, I am getting the following runtime error when converting my NSDictionary to JSON:\r\n'Invalid type in JSON write (__NSDate)'\r\n\r\nthis would indicate to me that the item is still an NSDate and not a string, as I would have expected.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/comments/150030155","html_url":"https://github.com/EasyMapping/EasyMapping/issues/117#issuecomment-150030155","issue_url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/117","id":150030155,"user":{"login":"DenHeadless","id":853604,"avatar_url":"https://avatars.githubusercontent.com/u/853604?v=3","gravatar_id":"","url":"https://api.github.com/users/DenHeadless","html_url":"https://github.com/DenHeadless","followers_url":"https://api.github.com/users/DenHeadless/followers","following_url":"https://api.github.com/users/DenHeadless/following{/other_user}","gists_url":"https://api.github.com/users/DenHeadless/gists{/gist_id}","starred_url":"https://api.github.com/users/DenHeadless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenHeadless/subscriptions","organizations_url":"https://api.github.com/users/DenHeadless/orgs","repos_url":"https://api.github.com/users/DenHeadless/repos","events_url":"https://api.github.com/users/DenHeadless/events{/privacy}","received_events_url":"https://api.github.com/users/DenHeadless/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T21:32:23Z","updated_at":"2015-10-21T21:32:23Z","body":"Can i ask you to provide example project or a test for this issue? \r\n\r\nIt is possible this is Swift-Objective-C interoperability issue."}}