This post is from the WWDC26 App Intents & Siri Q&A.
I’m currently using ShowInAppSearchResultsIntent to open the app in a selectable view with the search results. The user can choose which view to pick via a @Parameter. Though with iOS 27 I can’t compile this intent anymore, because of this error:
'ShowInAppSearchResultsIntent' must only have a 'criteria' parameter
What is the best practice to offer the same selection of the search view with iOS 27 and newer then?
My Code
import AppIntents
@AppIntent(schema: .system.search)
struct SearchAppIntent: ShowInAppSearchResultsIntent {
static let searchScopes: [StringSearchScope] = [.general]
var criteria: StringSearchCriteria
// MARK: Parameters
@Parameter(default: .loans)
var target: SearchView?
// MARK: Action Text
static var parameterSummary: some ParameterSummary {
Summary("Search \(\.$criteria) in \(\.$target)", table: "Shortcuts")
}
// MARK: Action
@MainActor
func perform() async throws -> some IntentResult {
switch target {
case .general, nil:
// Open app search tab
NavigationManager.shared.openAppSearch(with: criteria.term)
case .contacts:
// Open contacts tab
NavigationManager.shared.openContactsSearch(with: criteria.term)
}
return .result()
}
}
@alexander216 - Thanks for this. Would you mind filing a feedback for this issue?