Last active
April 15, 2016 15:35
-
-
Save jungchris/ce39496979da2d55ebaa26284686d2db to your computer and use it in GitHub Desktop.
Encode with Coder
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
func initWithCoder(aDecoder:NSCoder ) -> instancetype { | |
self = super.init() | |
self.seatUUID = aDecoder.decodeObjectForKey("seatUUID") | |
self.seatManuID1 = aDecoder.decodeObjectForKey("seatManuID1") | |
self.seatManuID2 = aDecoder.decodeObjectForKey("seatManuID2") | |
self.seatDataStructure = aDecoder.decodeObjectForKey("seatDataStructure") | |
self.seatBabyPresent = aDecoder.decodeObjectForKey("seatBabyPresent") | |
self.seatBatteryLevel = aDecoder.decodeObjectForKey("seatBatteryLevel") | |
self.seatSignalStrength = aDecoder.decodeObjectForKey("seatSignalStrength") | |
self.seatLastSignal = aDecoder.decodeObjectForKey("seatLastSignal") | |
self.seatName = aDecoder.decodeObjectForKey("seatName") | |
self.seatStatus = aDecoder.decodeObjectForKey("seatStatus") | |
return self | |
} | |
func encodeWithCoder(aCoder:NSCoder ){ | |
aCoder.encodeObject(self.seatUUID,forKey:"seatUUID") | |
aCoder.encodeObject(self.seatManuID1,forKey:"seatManuID1") | |
aCoder.encodeObject(self.seatManuID2,forKey:"seatManuID2") | |
aCoder.encodeObject(self.seatDataStructure,forKey:"seatDataStructure") | |
aCoder.encodeObject(self.seatBabyPresent,forKey:"seatBabyPresent") | |
aCoder.encodeObject(self.seatBatteryLevel,forKey:"seatBatteryLevel") | |
aCoder.encodeObject(self.seatSignalStrength,forKey:"seatSignalStrength") | |
aCoder.encodeObject(self.seatLastSignal,forKey:"seatLastSignal") | |
aCoder.encodeObject(self.seatName,forKey:"seatName") | |
aCoder.encodeObject(self.seatStatus,forKey:"seatStatus") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment