Saving Data in iOS

May 31 2022 · Swift 5.5, iOS 15, Xcode 13

Part 3: Property Lists

19. Property Lists Anatomy

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 18. Introduction Next episode: 20. Challenge: Saving Property Lists

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Notes: 19. Property Lists Anatomy

This course was originally recorded in April 2020. It has been reviewed and all content and materials updated as of November 2021.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

Property lists are very well supported on Apple platforms and you'll find yourself coming across many of them when developing for iOS, usually in the form of files with the .plist extension. For example, your application relies on a .plist file called Info, where some of it's configuration resides. Outside of Apple platforms though, property lists aren't commonly used. Part of that comes down to JSON having gained popularity over XML, which is how property list files are stored in a file. And some of that change is due to some people thinking JSON is easier to read. I personally prefer JSON, as it's super intuitive to read, interpret and write. Property lists are represented via XML. If you save them directly as XML strings, you can edit them by hand. But their file sizes will be bigger than equivalent JSON. However, you can save them as binary instead and then they can be smaller than JSON. The issue with that is that you'll be dependent on property list editing software. Fortunately, Xcode fits that description. Property lists effectively support the same types that JSON does. Booleans, numbers, strings and arrays. You've got all that. You don't have objects precisely, but you do have dictionaries with string keys, which translate to JSON objects. Date and data are technically natively supported, but that doesn't really translate to anything special. Aside from XML tags, dates are just ISO 8601 strings and data is also just a string. Xcode has a great editor for property lists. You can add, remove or edit the keys and values in a .plist file. It's certainly much cooler to visualize property lists in Xcode as opposed to JSON. But for everything else I personally prefer JSON.