Post

Replies

Boosts

Views

Activity

SwiftUI .onDelete not working on WatchOS
I'm building a standalone WatchOS app. I have tried implementing the .onDelete modifier to easily delete items in a list, and I get no warnings or errors in XCode. But swiping, both in the simulator and Live Preview, does not do anything. This is tested both in XCode 11.6 with WatchOS 6.2, and XCode 12.0 beta 2 with WatchOS 7. Am I missing something here? Minimal example: struct ContentView: View {     @State var names = ["Alpha", "Bravo", "Charlie", "Delta"]     var body: some View {         ScrollView {             ForEach(names, id: \.self) { name in                 Button(action: {}) {                     Text(name)                 }             }.onDelete(perform: deleteItems)         }             }     private func deleteItems(at offsets: IndexSet) {         names.remove(atOffsets: offsets)     } }
4
0
2.3k
Jul ’20
Problem with adding IAP capability to Independent WatchOS app
I have an independent WatchOS App that I wish to add IAP to. I have followed this guide (i.e. signed all documents and set up a product in App Store Connect) and set the deployment target to WatchOS 6.2, but when I want to add the IAP capability it does not show up as an availiable capability in the list. I suspect it is because I have 3 targets in my project ("WatchApp", "WatchApp WatchKit App" and "WatchApp WatchKit Extension") and, as I understand it, I need to add the IAP capability to the "WatchApp WatchKit Extension", while the Bundle ID in App Store Connect matches the Bundle Identifier of the "WatchApp" and not the "WatchApp WatchKit Extension". Do I have to delete the app from App Store Connect and recreate it such that the App Store Connect Bundle ID matches the WatchKit Extension Bundle Identifier?
5
0
2.5k
Mar ’20