Post

Replies

Boosts

Views

Activity

Map snapshot in WidgetKit does not call the completionHandler callback of `MKMapSnapshotter.start`
I've tried MKMapSnapshotter in the TimelineProvider , but the completion handler of the start is never called (snapshot is a MKMapSnapshotter object and I have verified that the callback is called when this code runs on the actual app and not the widget TimelineProvider. What am I missing? 		snapshot.start { (snapshot, error) in       let image = Image(uiImage: snapshot?.image)       completionHandler(image)     }
0
0
628
Nov ’20
iOS 17 beta 3: Virtual Keyboard does not move up TextField
In SwiftUI, Virtual Keyboard does not move TextField when the user taps on the TextField It works correctly on iPhone simulator (ie, the keyboard moves the TextField up so that it remains visible when the user taps on the TextField) but the keyboard cover the TextField on a real iPhone. It also works correctly on iPad. I filed a feedback. Do you see the same problem? Here is a code to reproduce the problem: import SwiftUI struct ContentView: View { @State private var name: String = "" var body: some View { ScrollView { Color.red .frame(height: 314) Color.yellow .frame(height: 314) } .padding() .scrollDismissesKeyboard(.interactively) TextField("Name:", text: $name) .padding() } }
8
5
3.5k
Jul ’23
Siri Watch Face and RelevantIntentManager
I am trying to add a watch widget that I've created for Smart Stack feature of watchOS 10 to also appear in the list of shortcuts shown in the Siri Watch Face. It seems like Apple now wants us to use RelevantIntentManager for this purpose, but my widget never shows up in the Siri Watch face. This is the code that I am using. func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline<GenericEntry> { [...] await updateRelevantIntents() return timeline } func updateRelevantIntents() async { var relevantIntents = [RelevantIntent]() let defaults = UserDefaults.init(suiteName: "group.tesla.watch.maadotaa")! guard let name2VIN = defaults.dictionary(forKey: Constants.VEHICLE_NAME_VIN_DICT) as? [String:String] else { return } let carNames = Array(name2VIN.keys) for (idx, name) in carNames.enumerated() { let intent = ConfigurationAppIntent() intent.order = idx intent.carName = name intent.action = nil let txt = "\(name): info only" let relIntent = RelevantIntent(intent, widgetKind: "WatchWidget", relevance: RelevantContext.date(from: .now, to: .now + 3600 * 1)) relevantIntents.append(relIntent) } do { try await RelevantIntentManager.shared.updateRelevantIntents(relevantIntents) } catch (let error) { print("\(#function): \(error.localizedDescription)") } }
1
0
607
Aug ’23