SwiftyJSON/SwiftyJSON — pull request #103 by Dschee (2014-12-02 01:22:40+00:00)
Title: Added read option for date strings

I agree with https://github.com/SwiftyJSON/SwiftyJSON/pull/87/files and https://github.com/SwiftyJSON/SwiftyJSON/pull/85/files that SwiftyJSON lacks of date support which nearly everyone using JSON APIs will need at some point and that SwiftJSON should support dates somehow.

But I also understand @tangplin's answer that there are too many different formats for dates in JSON APIs. So what about the idea to not deeply integrate dates into SwiftyJSON but at least add a helper method that makes getting dates from JSON objects much easier.

I have added an example implementation of what this could look like for dates formatted in String type. The user of SwiftyJSON would still need to provide the correct date formatter for the API he/she is using which solves the problem with too many formats (at least for String formats, but one could of course add support for Number formats as well).