Post

Replies

Boosts

Views

Activity

Changing watchOS Deployment Target - What happens to users on old versions
This is probably a silly question, but I couldn't find the answer to it in the forums or in the documentation, though I may be missing something. I currently have an app with a deployment target of iOS 16 and a watchOS app (not independent) with a deployment target of watchOS 7. I understand what happens when I change the deployment target on the iOS app (e.g., users with iOS/iPadOS versions less than 16 will just never see the updates in the App Store). But what happens if I change the deployment target of the watchOS dependent app to something like watchOS 8? Will users who have iOS 16 and watchOS 7 (iOS meets deployment target/watchOS does not) get the app update, and it'll just uninstall the watchOS app automatically? Will they just not see the update? Does the old version of the Watch app somehow stay on their watch while the iOS app gets updated?
1
0
1.1k
May ’23
SwiftUI MapKit - MapAnnotation - Publishing changes from within view updates is not allowed, this will cause undefined behavior.
So I'm trying to use MapKit in a SwiftUI project targeting iOS/iPadOS. MapKit is obviously pretty limited in SwiftUI, but I've been getting warnings trying to set up basic annotations for the user to interact with. When I use a basic MapMarker everything is fine (although it's hard to do anything with it), but whenever I do anything with MapAnnotation, I get this warning in Xcode (14.0.1) whenever I move the map around: [SwiftUI] Publishing changes from within view updates is not allowed, this will cause undefined behavior. I'm no SwiftUI expert, and I get how to fix this issue when binding in something like a sheet, but I don't see how what I'm doing with MapAnnotation should be causing this. It looks like a bug to me, possibly complaining about the $region binding, but maybe I'm wrong? Am I doing something wrong or is this a bug? Below is some sample code that reproduces this easily for me (just launch an app with the below code and then drag the map around to see the constant warnings in Xcode). It's mostly an example from here: https://www.hackingwithswift.com/books/ios-swiftui/integrating-mapkit-with-swiftui import SwiftUI import MapKit struct Location: Identifiable {     let id = UUID()     let name: String     let coordinate: CLLocationCoordinate2D } struct ContentView: View {     @State private var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 51.5, longitude: -0.12), span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2))     let locations = [         Location(name: "Buckingham Palace", coordinate: CLLocationCoordinate2D(latitude: 51.501, longitude: -0.141)),         Location(name: "Tower of London", coordinate: CLLocationCoordinate2D(latitude: 51.508, longitude: -0.076))     ]     var body: some View {         Map(coordinateRegion: $region, annotationItems: locations) { location in             MapAnnotation(coordinate: location.coordinate) {                 Circle()                     .stroke(.red, lineWidth: 3)                     .frame(width: 44, height: 44)             }         }         .navigationTitle("Map")         .edgesIgnoringSafeArea(.all)     } }
19
14
7.9k
Oct ’22
MapKit JS MarkerAnnotation Cursor
I'd like to change the cursor to cursor:pointer when I hover over a MarkerAnnotation with a mouse, but I can't seem to figure out how to do it. CSS selectors such as div.mk-annotations>div don't match, and it appears that MapKit JS is doing some things with styles. DuckDuckGo seems to be accomplishing this in MapKit JS (among other things) by extending the objects. I'd prefer to do something that's not so invasive, though. Maybe I'm missing something super obvious? Any help?(I can also create a custom Annotation with that piece of desired behavior, but I haven't been able to figure out how to align it correctly at different zoom levels -- I'd like to use a marker that is a pin position [i.e. the bottom center of the marker points to the coordinate, like MarkerAnnotation], rather than a circle that is meant to be centered over a coordinate. So I started trying to use anchorOffset in the constructor options, but the offset really needs to be different at different zoom levels, and MapKit JS doesn't seem to keep the perspective component of DOMPoint when I use that. Anyway, I'd prefer to use MarkerAnnotation, if possible.)
1
0
858
Jun ’20