Creating model objects for the Photo Filter screen
To get the information from FilterData.plist
into your app, you'll create a class, FilterItem
, that can store details about a filter, and a data manager class, FilterManager
, that will load FilterData.plist
and create an array of FilterItem
instances. This is similar to the method used to load cuisine and location information into your app. Let's start by creating the FilterItem
class. Follow these steps:
- Right-click the
Model
folder in thePhotoFilter
folder and select New File. - iOS should already be selected. Choose Swift File and click Next.
- Name this file
FilterItem
. Click Create.FilterItem.swift
will appear in the Project navigator. - After the
import
statement, type the following code insideFilterItem.swift
to declare and define theFilterItem
class:class FilterItem:NSObject { let filter:String let name:String init(dict:[String...