-
-
Save vikitripathi/f949ecb4fa03388524fb06f08528eb89 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