Someone from Apple please provide an update on this.
Post
Replies
Boosts
Views
Activity
i would also like to know, i'm trying to release an independent watch app with in-app purchases but how do i do that without StoreKit?
Is there something that pops up on your watch where you have to press Trust?
import SwiftUI
struct CardTheme: View {
//@State private var theme = 0
@State private var theme = UserDefaults.standard.integer(forKey: "Card Theme")
var body: some View {
List {
HStack {
Text("Mono")
//.font(.system(size: 12))
.onTapGesture {
self.setTheme(i: 0)
}
Spacer()
if(theme == 0) {
Image(systemName: "checkmark")
.foregroundColor(Color.green)
}
}
HStack {
Text("Cool")
// .font(.system(size: 12))
.onTapGesture {
self.setTheme(i: 1)
}
Spacer()
if(theme == 1) {
Image(systemName: "checkmark")
.foregroundColor(Color.green)
}
}
HStack {
Text("Cute")
// .font(.system(size: 12))
.onTapGesture {
self.setTheme(i: 2)
}
Spacer()
if(theme == 2) {
Image(systemName: "checkmark")
.foregroundColor(Color.green)
}
}
}
.navigationBarTitle(Text(verbatim: "Card Theme"))
}
func setTheme(i: Int) {
theme = i
UserDefaults.standard.set(i, forKey: "Card Theme")
}
}Sorry I'm having trouble following your code. But if I modified mine to use UserDefaults, i can see that it is correctly saving and retrieving the selection as I can close the app and re-open it and have the correct theme row ticked. The only issue is when I go back to the previous view and re-enter the Card Theme view, it is still showing the same selection as from when the app loaded, rather than any changes in selection since the app loaded. Is there a quick fix for that? For example can I incorporate @EnvironmentObject? Thanks.
I've updated to Xcode 11.2.1 and still get this error. The Apple feedback assistant team think it's because my iPhone is not connected to my computer...
'GroupedListStyle' is unavailable in watchOS