Kilo Loco shows you how to get the user/device location using CoreLocation to access location updates, Combine to send data, and SwiftUI to display the user's coordinates.
Article:
https://www.kiloloco.com/articles/014-device-location-ios/
Project:
https://github.com/Kilo-Loco/content/tree/main/apple/device-location-ios