Implementing MapKit
We'll start by creating a new SwiftUI View; 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 SwiftUI View from the User Interface options and click Next. Call your new file RecipeMapView.swift and click Create.
Now we'll create another helper file called MapKitHelper 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 MapKitHelper.swift and click Create.
Inside our helper, make the following changes. Note the import statement at the top of the file; this is needed to tell our ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access