diff --git a/StepMap.xcodeproj/project.pbxproj b/StepMap.xcodeproj/project.pbxproj index c7764c3..fc5a1ac 100644 --- a/StepMap.xcodeproj/project.pbxproj +++ b/StepMap.xcodeproj/project.pbxproj @@ -255,6 +255,8 @@ DEVELOPMENT_TEAM = SSJBLTMP95; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "We need to access your location to set starting point of your route"; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "We need to access your location to set starting point of your route"; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -284,6 +286,8 @@ DEVELOPMENT_TEAM = SSJBLTMP95; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "We need to access your location to set starting point of your route"; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "We need to access your location to set starting point of your route"; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; diff --git a/StepMap/ContentView.swift b/StepMap/ContentView.swift index 3fb802e..1e0afed 100644 --- a/StepMap/ContentView.swift +++ b/StepMap/ContentView.swift @@ -5,11 +5,13 @@ // Created by Oliver Hnát on 23.11.2024. // +import CoreLocation import MapKit import SwiftUI struct ContentView: View { @ObservedObject var viewModel = ViewModel() + @StateObject var locationManager = LocationManager() @State private var position = MapCameraPosition.automatic @State private var showSearch: Bool = true @@ -25,17 +27,37 @@ struct ContentView: View { var body: some View { Map(position: $position) { - ForEach(0..