Post

Replies

Boosts

Views

Activity

Reply to Map Switcher MapKit iOS 14 and up
Hello, thank you so much for your reply and help. I have actually already tried switching to MKMapView, but that would unfortunately break some other things such as reliable user following/tracking and the automated shifting between it being enabled on a button press and disabled when dragging the Map around. I know that apps even pre iOS 14 did that properly, for example I got an iPhone 7 with iOS 12 running an older, still supported version of the Geocaching app which has map switching and proper tracking / user following. For context here's how my tracking works. I basically got a Location Manager class with the needed functions that looks like this (plus a few extra functions like getting authorization to use the location that are irrelevant for this problem): class LocationManager: NSObject, ObservableObject, CLLocationManagerDelegate { private let locationManager = CLLocationManager() private var hasCenteredOnUser = false @Published var authorizationStatus: CLAuthorizationStatus = .notDetermined // Centre Germany @Published var region = MKCoordinateRegion( center: CLLocationCoordinate2D( latitude: 51, longitude: 10.5), span: MKCoordinateSpan( latitudeDelta: 9, longitudeDelta: 9)) override init() { super.init() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { guard let location = locations.last else { return } if !hasCenteredOnUser { DispatchQueue.main.async { self.region = MKCoordinateRegion( center: location.coordinate, span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05) ) self.hasCenteredOnUser = true } } } //For the button to get the location func getCurrentLocation() -> CLLocationCoordinate2D? { return locationManager.location?.coordinate } } Honestly I can't really believe that ma switching is not possible in MapKit for SwiftUI for iOS 14, that would be crazy as it is such a simple function. You said that it doesn't re-render because it needs to be truly different. But why isn't it? Can't we maybe figure out a solution there to force it to re-render? As I said, thanks so much already.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’25
Reply to Copying of app targets and corresponding files from older Xcode projects to a current one
Good evening, thanks so much for your reply. That however is also not an issue for me, as I can still code and test the older structured app by using Xcode 12 for that and an Apple Watch Series 5 with watchOS 6.2 I have for such testing purposes. Once that is done I won't change that version by much anymore, I just need to import it to the existing project for compatibility with the basic functions. As the core of my app will be a pretty basic but for some people daily used functionality I want to have as much compatibility as possible so everyone can use it, not only people with reasonably new hardware. More special features that are not as important for the core function can still be implemented for newer versions, and that will be where my attention is going to be for future development. Debugging of the storyboard version won't be necessary once it is in that project, as nothing will really change for that. I just want to have that base line of functionality for everyone. Maybe I could explain my motivation for this a bit better. For the same reason I am successfully developing the main iOS version for iOS 14+ while still adding newer features and even more modern design (like Liquid Glass elements) if it is supported by the OS. So my question remains the same and maybe it can be answered without that specific use case: How can targets be copied over from one project to another while keeping all properties and data, so it would just work like in the other project? Thanks again
Oct ’25