Created
June 6, 2017 06:07
-
-
Save akring/1b3f9dd37fb9a0f9f90ffddc0c892eb6 to your computer and use it in GitHub Desktop.
Revisions
-
akring created this gist
Jun 6, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ let intTransform = TransformOf<String, Int>(fromJSON: { (value: Int?) -> String? in // transform value from String? to Int? if let value = value { return String(value) } return nil }, toJSON: { (value: String?) -> Int? in // transform value from Int? to String? return Int(value!) })