Post

Replies

Boosts

Views

Activity

Questions about LockedCameraCapture
Can the extended code created by Capture Extension call the code of the main project? I added the control via Widget Extension and I see the perform method is called in my intent but I am missing the part where this perform method will open the UI to capture the photo. This is my intent: struct MyAppCaptureIntent: CameraCaptureIntent { static var title: LocalizedStringResource = "MyAppCaptureIntent" typealias AppContext = MyAppContext static let description = IntentDescription("Capture photos with MyApp.") @MainActor func perform() async throws -> some IntentResult { let dialog = IntentDialog("Intent result") do { if let context = try await MyAppCaptureIntent.appContext { return .result() } } catch { // Handle error condition. } return .result() } } struct MyAppContext: Decodable, Encodable { var data = ContextData() } struct ContextData: IntentResult, Decodable, Encodable { var value: Never? { nil } } How can I connect this with my LockedCameraCaptureExtension? Can you provide a complete demo?
1
0
465
Aug ’24