'GroupedListStyle' is unavailable in watchOS
Post
Replies
Boosts
Views
Activity
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...
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.
Is there something that pops up on your watch where you have to press Trust?
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?
Someone from Apple please provide an update on this.
Looks like in-app purchases are coming to watchOS! Is there a good code tutorial for it, seems extremely complicated.
Very excited about this, are there any code tutorials on how to implement this on watchOS?
I have copied the files over but it doesn't compile:Could not find or use auto-linked framework 'StoreKit'
Undefined symbol: _OBJC_CLASS_$_SKProduct
Undefined symbol: _OBJC_CLASS_$_SKProductsRequest
Hi, I've recently been getting precondition failure: invalid input index: 2 errors too after the latest Xcode 11.4 update. I use GeometryReader to read the user's Watch screen size so i can draw a frame that is relative in size. Unfortunately NavigationView is not available on WatchOS so I'm not sure what other solutions are available. Do you have any ideas? Thanks.
No luck, and haven't heard anything back on a seperate thread I started. I have filed an issue with the Feedback Assistant and hopefully we will get a response from Apple.
I just tried this, and only the first utterance is outputted in Cantonese, no audio output for the second Mandarin utterance. Do you know why this is?
I put it inside applicationDidFinishLaunching as follows:
notificationCenter = UNUserNotificationCenter.current()
		notificationCenter.removeAllPendingNotificationRequests()
		let options: UNAuthorizationOptions = [.alert, .sound, .badge]
		notificationCenter.requestAuthorization(options: options) {
			(didAllow, error) in
			if !didAllow {
				print("User has declined notifications")
			}
		}
I tried the code you posted above:
let synth = AVSpeechSynthesizer()
let cantoUtterance = AVSpeechUtterance(string: chinese)
cantoUtterance.voice = AVSpeechSynthesisVoice(identifier: "com.apple.ttsbundle.Sin-Ji-compact")
synth.speak(cantoUtterance)
let mandoUtterance = AVSpeechUtterance(string: chinese)
mandoUtterance.voice = AVSpeechSynthesisVoice(language: "zh-CN")
synth.speak(mandoUtterance)
and on my Watch I only hear the first utterance.
Thanks - I created it as a property and it is no longer being deallocated after the first utterance.