How to Get User Location on a Map - Swift

Описание к видео How to Get User Location on a Map - Swift

Head to https://squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.

In today's video I show you how to show a user's location on a map in SwiftUI using MapKit and CoreLocation. We also discuss how to ask for location permission and handle the various permission states.

This tutorial was created in Xcode 13 and iOS 15 (betas).

*** Yes, I'm aware of the new LocationButton released with iOS 15. Because that requires iOS 15, that will be a separate video in the future.

If you like my teaching or presentation style, I've started creating my own courses:
https://seanallen.teachable.com/

CLLocationManager Documentation:
https://developer.apple.com/documenta...

Twitter:
  / seanallen_dev  

Link to my book - How I Became an iOS Developer:
https://gumroad.com/l/sean-allen-origin

Timestamps
0:00 - What You’ll Learn
0:11 - Display a Map
3:13 - MKCoordinateSpan
3:58 - Begin User Location Process
5:10 - ViewModel & Architecture Discussion
6:28 - CLLocationManager Setup
8:57 - Check App’s Authorization & Request Permission
12:30 - Property List Setup for Location Permissions
13:42 - CLLocationManagerDelegate Setup
17:01 - Where to call checkIfLocationServiceIsEnabled()
18:10 - Set Location of Simulator
18:28 - Test Location Permission
19:09 - Center Map on User Location
23:17 - Light Refactor & Cleanup

Hired.com:
https://hired.com/x/1n01g

Check out my podcast, iOS Dev Discussions:
https://itunes.apple.com/us/podcast/i...

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Paul Hudson's Hacking With Swift:
https://gumroad.com/a/762098803

Donny Wals - Combine:
https://gumroad.com/a/909014131

Mark Moeyken’s SwiftUI Books:
www.bigmountainstudio.com/swiftui-views-book/fzc51

Objc.io Books (Thinking in SwiftUI & Advanced Swift):
https://gumroad.com/a/656585843

Ray Wenderlich Books:
https://store.raywenderlich.com/a/208...

Links to my iOS Dev Setup & iOS Dev Book Recommendations
https://www.amazon.com/shop/seanallen

#swift #softwaredeveloper #iosdeveloper

Комментарии

Информация по комментариям в разработке