Creating our Map Data Manager
In the next chapter, we will deal with data, but for now, we can mock up some data in order to set up our structure. We will use a plist
to load our data, just like we did in the last chapter.
Let's create the MapDataManager
file now:
- Right-click on the
Model
folder in theLocation
folder and select New File. - Inside of the Choose a template for your new file screen, select iOS at the top and then Swift File. Then, hit Next.
- Name this file,
MapDataManager
and then hit Create. - Next, we need to define our class definition, so add the following under the import statement:
class MapDataManager {}
- Inside of the class declaration, add the following variables:
fileprivate var items:[RestaurantAnnotation] = [] var annotations:[RestaurantAnnotation] ...
Get iOS 10 Programming for Beginners now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.