Created
November 5, 2017 12:24
-
-
Save pgpt10/c4582681b38d3c8ba33ca1c359a2be9d to your computer and use it in GitHub Desktop.
This file contains 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 characters
class City: NSObject, NSCoding | |
{ | |
var name: String? | |
var id: Int? | |
required init?(coder aDecoder: NSCoder) | |
{ | |
self.name = aDecoder.decodeObject(forKey: "name") as? String | |
self.id = aDecoder.decodeObject(forKey: "id") as? Int | |
} | |
func encode(with aCoder: NSCoder) | |
{ | |
aCoder.encode(self.name, forKey: "name") | |
aCoder.encode(self.id, forKey: "id") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment