I am using Swift in an iOS Xcode project. I would like to use the Data or NSData object in the Apple Foundation and UIKit Frameworks to manipulate binary data so that each binary digit represents a boolean value -- 0 being false, and 1 being true.
How would I do that?
I would save the Data object in CloudKit as a field of type Bytes.
If there is an easier or more practical way for me to use boolean values that takes less memory and is more efficient, please suggest it to me.
I seem to recall there was a way to format numbers to a binary expression. That would help me accomplish my objective.