The iOS map view is incredibly easy to implement and use.  Let’s discover how to show our location with Apples own maps embedded into an iOS and Swift app.

How to Use an iOS Map View

1. Drop an MKMapView into the view on your storyboard:

Map View inside of a View Controller

2. Select the Map View and over in properties make sure that ‘User Location’ option is selected.

Options for displaying location in Apple Maps

3. Inside of the associated View Controller class, make the class inherit from CLLocationManagerDelegate

4. Create a class level variable to hold the Location Manager:

5. In the ViewDidLoad method use the following code to ask for permission for location services:

Now run your iOS map app and your location should be displayed once it asks for your permission!

Where to go Next

This tutorial comes straight out of The Complete iOS Developer Course. Over 40 hours long it contains everything you need to create awe inspiring apps fast!

Click here to check it out!

Showing Your Location with an iOS Map View and Swift

Leave a Reply

Your email address will not be published. Required fields are marked *

Share This

Want this Post in Easy to Understand Video Form?

Then get the Complete iOS Developer Course. Over 50 hours of pure Swift coding goodness designed to turn you into a coding master!

One Time Offer - $9! Click to Get it!



WARNING: Once this box is closed the offer will not be shown again.

Thank you!