April 2020
Beginner
316 pages
8h 20m
English
Our first job is to create a MapLocationManager class. This will house all the logic required to obtain our current (or simulated) location and pass the relevant details back up to our main view in order for them to be displayed in SwiftUI.
Let's start by creating a new class; we'll create a new file in our Xcode project called RecipeMapView by highlighting the group name in the file tree, then right-clicking and selecting New File. Select Cocoa Touch Class from the User Interface options and click Next. Call your new file MapLocationManager.swift (making sure this is a subclass of NSObject) and click Create.
First things first, let's import the required frameworks. Add the following to the top of your class: ...
Read now
Unlock full access