diff --git a/README.md b/README.md index a22cdf15..20f410b7 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ For example, if you want to transform a JSON String value to an Int you could us ```swift let transform = TransformOf(fromJSON: { (value: String?) -> Int? in // transform value from String? to Int? - return value?.toInt() + return Int(value!) }, toJSON: { (value: Int?) -> String? in // transform value from Int? to String? if let value = value { @@ -170,7 +170,7 @@ id <- (map["id"], transform) ``` Here is a more condensed version of the above: ```swift -id <- (map["id"], TransformOf(fromJSON: { $0?.toInt() }, toJSON: { $0.map { String($0) } })) +id <- (map["id"], TransformOf(fromJSON: { Int($0!) }, toJSON: { $0.map { String($0) } })) ``` # Subclasses