To save a CBPeripheral instance in Core Data, you can make it conform to the NSCoding protocol:
main.swift646 chars20 lines
Now you can save the CBPeripheral object in Core Data by converting it to NSData and storing it in the PeripheralObject
instance:
main.swift377 chars12 lines
To retrieve the CBPeripheral instance, you can fetch the PeripheralObject
from Core Data and deserialize the NSData back into a CBPeripheral:
main.swift511 chars15 lines
gistlibby LogSnag