Created
June 23, 2014 20:49
-
-
Save axiixc/d0aa5dd798fd926143be to your computer and use it in GitHub Desktop.
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 characters
// class CountDownEvent { | |
// init(endDate: NSDate, name: String); | |
// } | |
extension CountDownEvent: NSSecureCoding { | |
convenience init(coder: NSCoder!) { | |
let endDate = coder.decodeObjectOfClass(NSDate.classForCoder(), forKey: "endDate") as NSDate | |
let name = coder.decodeObjectOfClass(NSString.classForCoder(), forKey: "name") as NSString | |
self.init(endDate: endDate, name: name) // Is this not how you call another initializer? | |
} | |
func encodeWithCoder(coder: NSCoder!) -> Void { | |
coder.encodeObject(endDate, forKey: "endDate") | |
coder.encodeObject(name, forKey: "name") | |
} | |
class func supportsSecureCoding() -> Bool { | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment