Post

Replies

Boosts

Views

Activity

Reply to Control Center Widget: Unable to read configuration from ControlConfigurationIntent in SetValueIntent
Just to close the loop on this: when creating a widget extension, Xcode has a template to create this timer, which it does as follows: struct StartTimerIntent: SetValueIntent { static let title: LocalizedStringResource = "Start a timer" @Parameter(title: "Timer Name") var name: String @Parameter(title: "Timer is running") var value: Bool init() {} init(_ name: String) { self.name = name } func perform() async throws -> some IntentResult { // Start the timer… return .result() } } So anyway, the timer name needs to be marked as @Parameter, and mustn't be optional.
Jul ’24
Reply to Xcode 15: Core Data : No NSValueTransformer with class name *** was found for attribute YYY on entity ZZZ for custom `NSSecureUnarchiveFromDataTransformer`
I'm also seeing this issue recently and cannot figure out why. Nothing has changed from my end, and everything works as expected. Transformable field in data model Correct class in the Transformer field Class is registered early in app lifecycle (in same class as Core Data container is created) Not using Swift Data Am using model versions in .xcdatamodel It feels like an issue related to the analysis during build time. I've submitted FB13311957.
Oct ’23
Reply to Siri Watch Face and RelevantIntentManager
My understanding is that the RelevantIntentManager / Smart Stack replaces the Siri Watch Face. The Siri Watch Face is effectively now deprecated, since it doesn't support suggestions that use AppIntent (only INIntents). Having said all that: I'm having the same issue, in that no matter what I pass to RelevantIntentManager.shared.updateRelevantIntents, my widget is never automatically displayed in the Smart Stack in the same way that "Now Playing", "Stopwatch", "News" etc.. do. I also can't find anything relevant in Console that would suggest something is going wrong. The widget can be added manually to the Smart Stack, but I want it to populate/depopulate automatically.
Oct ’23
Reply to Does HealthKit in iOS 17 provide any APIs related to mood tracking?
It appears that this isn't available, even though the "Data Sources & Access" screen for it makes it sound possible. Even just read-only access would be super useful. It's a bit frustrating that this and the medications data hasn't been opened up to third-party developers. I understand that the medication data is structured in a completely different way to the rest of HealthKit, so there's definitely much more complexity there, but the mood tracking records appear to be simple flat records like everything else. I've filed FB13069949 about accessing State of Mind data.
Aug ’23
Reply to Widget URL on complication
You can't achieve both ClockKit and SwiftUI with the same method. In ClockKit, you need to read the userInfo in handleUserActivity In SwiftUI, you need to use .onOpenURL. The problem I'm having though is if I use .widgetURL() in the SwiftUI view, it causes the complication to flash off/on on the watch face when the watch becomes active.
Jul ’23
Reply to Unable to set the new App Tint Color options for App Shortcuts
After a bit of help on Twitter, here's how to get this working: Add the shortTitle and systemImageName parameters in your AppShortcut(). If none of your shortcuts have this, the coloured panel won't appear in Shortcuts app. The system image name is from SF Symbols. Create colours in your main app's asset catalog (e.g. ShortcutsBackground1, ShortcutsBackground2 and ShortcutsForeground Now add NSAppIconActionTintColorName and NSAppIconComplementingColorNames in your Info.plist. This needs to go within CFBundlePrimaryIcon. For example: <dict> ..... <key>CFBundleIcons</key> <dict> <key>CFBundlePrimaryIcon</key> <dict> .... <key>NSAppIconActionTintColorName</key> <string>ShortcutsForeground</string> <key>NSAppIconComplementingColorNames</key> <array> <string>ShortcutsBackground1</string> <string>ShortcutsBackground2</string> </array> </dict> </dict> </dict>
Jul ’23