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
enum Status: Int { | |
case Good | |
case Bad | |
} | |
// Status.RawValue == Int not NSData, therefore this extension should not be applied to status | |
extension RawRepresentable where RawValue == NSData, Self: NSCoding { | |
init?(rawValue: NSData) { | |
if let instance = NSKeyedUnarchiver.unarchiveObjectWithData(rawValue) as? Self { | |
self = instance |