Storing a user-selected location in LocationViewController

At present, LocationDataManager loads data from Locations.plist and stores location information in an array of strings. You will create a new structure, LocationItem, and configure LocationDataManager to use it to store a location. After that, you'll modify LocationViewController so that it can store a LocationItem instance containing the location selected by the user. You can then pass this LocationItem instance to the other view controllers in your project. Perform the following steps:

  1. Right-click on the Model folder inside the Location folder and select New File.
  2. iOS should already be selected. Choose Swift File and then click Next.
  3. Name this file LocationItem. Click Create.

Get iOS 13 Programming for Beginners - Fourth Edition 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.