In the last chapter, we used a provided plist to load our cuisine list. We will do the same in this chapter, but now that you are familiar with what a plist is, we will create one from scratch together.
I use plists all the time, from creating menus to having a file that holds app settings such as colors or social media URLs. I find them very useful, especially if I need to come back later and update or change things.
Let's learn how to create a plist from scratch. To create a plist in Xcode, do the following:
- Right-click on the
Model
folder insideLocation
and selectNew File
. - In
Choose a template for your new file
, selectiOS
at the top, and then typeProperty
in the filter field:
- Select
Property List
and then hitNext
. - Name the file
Locations
and hitCreate
.