Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Zelda

macrumors member
Original poster
Aug 10, 2014
39
2
I am looking for information to write and read a Swift Dictionary to the Documents directory of iOS.
Can this be done?
Any pointers?
Thanks
 
You can't simply "save" a dictionary directly to a file, it's just a data structure. You need to create a file where the dictionary data can be held within a container and saved such as a plist. A plist is a simple file format that mimics a dictionary structure with a type "key:value" container. iOS has native support for this so Google around and look for "save dictionary to plist".
 
Ah, ok I did notice quite a few search results about plist and Swift dictionary's.
Thank you, I appreciate your answer.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.