Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jungchris
Last active April 15, 2016 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jungchris/ce39496979da2d55ebaa26284686d2db to your computer and use it in GitHub Desktop.
Save jungchris/ce39496979da2d55ebaa26284686d2db to your computer and use it in GitHub Desktop.
Encode with Coder
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