Writing a swift dictionary to a binary file

I have a developed iOS application which collects capture data from the front camera of an iPhoneX in a swift dictionary. This dictionary contains large sets of 32bit float values. If I save this dictionary as .plist it will become a larger file (like 1.5GB) so I need to save this dictionary as a binary file to reduce the size? How can I do this using swift? I'm new to iOS development so your help would be really appreciated.

Hi. Have you tried set the PropertyListEncoder outputFormat to .binary? https://developer.apple.com/documentation/foundation/propertylistserialization/propertylistformat

1 Like
Terms of Service

Privacy Policy

Cookie Policy