Post

Replies

Boosts

Views

Activity

Migration to AppIntents doesn't work for dynamic options provider type.
We are using Intent for app shortcuts which allows user to select name from array of string. In the intent, there is only one parameter name. After migrating to app intent, it does not preserve the name of existing shortcut and every time it asks for the name. For example, I have an existing app shortcuts with name "Book 1". After migrating to AppIntent, if I run same shortcut, it ask for the name again. We are passing same books array in DynamicOptionsProvider and provideNameOptionsCollection method.. Here is the code: @available(iOS 16.0, *) struct CreateBook: AppIntent, CustomIntentMigratedAppIntent, PredictableIntent { static let intentClassName = "BookIntent" // Intent name: Book static var title: LocalizedStringResource = "Book" static var description = IntentDescription("Book") @Parameter(title: "Name", optionsProvider: BookNamesOptionsProvider()) var name: String? private struct BookNamesOptionsProvider: DynamicOptionsProvider { func results() async throws -> [String] { ["Book 1", "Book 2"] } } static var parameterSummary: some ParameterSummary { Summary("Create \(\.$name)") } static var predictionConfiguration: some IntentPredictionConfiguration { IntentPrediction(parameters: (\.$name)) { name in DisplayRepresentation( title: "Create \(name!)", subtitle: "Create Book" ) } } func perform() async throws -> some IntentResult { ... } }
0
0
491
Aug ’23
App Intent snippet view does't able to fetch color for xcassets.
We have an existing app in which we have implemented AppShortcuts. The snippet view works fine in iOS 17 while in iOS18 beta, it doesn't able to fetch color from xcassets. If we use system colours or UIColor it's working fine. Not working Color("progressColor") Working Color(uiColor: UIColor(named: "progressColor")!) Color.red Color(hex: "3881d3") // Note: We created Color extension to generate color from hex string.
0
2
368
Jun ’24
How to change selected tab title color in iPadOS 18?
I applied image tint color to TabBar. It works fine when I decrease the window width using stage manager. Also it shows proper in iPhone. But it doesn't show orange title in compact style. I also tried below things: self.tabBar.tintColor = .orange self.tabBar.unselectedItemTintColor = .gray The only solution is to set AccentColor in Assets.xcassets. But what if I want to change different color than AccentColor?
3
0
338
Jul ’24