SwiftUI App Intents

up:: SwiftUI onboarding

WWDC24: Bring your app’s core features to users with App Intents | Apple #10 - App Intents - by Artjoms Vorona - Curated iOS The way we interact with apps is changing, so should the way they are designed. Getting Started With App Intents

  • Intents: Verbs (actions)
    • Appear in the shortcuts app
  • Entities: Nouns (classes)
  • App shortcuts: Sentence (common functions)

No parameter

struct OpenGenerateView: AppIntent {
    static let title: LocalizedStringResource = "Generate a book image"
    
    func perform() async throws -> some IntentResult {
        // app logic
        return .result()
    }
    
    static let openAppWhenRun: Bool = true
}