Skip to content

Commit

Permalink
Merge pull request #680 from lohmander/master
Browse files Browse the repository at this point in the history
Change NSDate to Date in README
  • Loading branch information
tristanhimmelman committed Nov 24, 2016
2 parents 1128cfd + 9b561e2 commit 5d821dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class User: Mappable {
var dictionary: [String : AnyObject] = [:]
var bestFriend: User? // Nested User object
var friends: [User]? // Array of Users
var birthday: NSDate?
var birthday: Date?

required init?(map: Map) {

Expand Down Expand Up @@ -302,7 +302,7 @@ ObjectMapper also supports custom transforms that convert values during the mapp
```swift
birthday <- (map["birthday"], DateTransform())
```
The above transform will convert the JSON Int value to an NSDate when reading JSON and will convert the NSDate to an Int when converting objects to JSON.
The above transform will convert the JSON Int value to an Date when reading JSON and will convert the Date to an Int when converting objects to JSON.

You can easily create your own custom transforms by adopting and implementing the methods in the ```TransformType``` protocol:
```swift
Expand Down

0 comments on commit 5d821dc

Please sign in to comment.