Use the camera for keyboard input in your app

RSS for tag

Discuss the WWDC21 session Use the camera for keyboard input in your app.

Posts under wwdc21-10276 tag

11 Posts

Post

Replies

Boosts

Views

Activity

Use Live Text in SwiftUI
Menu {                 Button(action: {                     // TODO: support live text                 }) {                     Label("Live Text", systemImage: "camera.viewfinder")                 }             } label: {                 Text("Hi")             } How can I present the live text view in swiftUI
1
0
1.5k
Jun ’23
Notification service extension not called on flutter iOS
Issue:- When getting remote notification have to show image using the imageurl in payload. In Android it’s working fine once we changed the payload. In iOS image not showing in push notification. Issue facing on Notification Service Extension:- I have added the notification extension and added the code for modifying notification content. This configuration is working fine in native iOS app. Added the same in the flutter iOS project but there it won’t work. While receiving push notification the extension is not getting called. Just receiving normal notification only. I have tried many scenarios to sort out this issue. Still it’s not working. Steps i’ve followed: Added code to get notification permission Added Notification extension to the project Used automatically manage signing for profile configuration Added code to modify notification Added imageURL and mutable-content keys in payload Added the project and payload screenshots here
1
0
2.0k
Dec ’21
Not getting callback after tapping "Insert text" button in text on camera for UITextField
I have implemented Text on camera feature in two ways UITextField with UITextContentType and UIKeyboardType as emailAddress, which helps to show a button in the keyboard to open the camera for capturing email. UITextField with basic text. I implemented a custom UIButton to open the camera for capturing text for this field. In both cases I'm not getting callback in any of these functions insertText(_ text) setMarkedText(markedText:, selectedRange:) and unmarkText() after user taps Insert Text button. Help me.
3
0
2.1k
Sep ’21
Camera UI crash
CameraUI -[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:] i am seeing crashes on firebase and here is the stacktrace Fatal Exception: NSGenericException *** Collection <__NSArrayM: 0x28024a0a0> was mutated while being enumerated. keyboard_arrow_up 0 CoreFoundation __exceptionPreprocess 2 arrow_drop_down CoreFoundation -[__NSSingleObjectEnumerator initWithObject:collection:] arrow_right 3 CameraUI -[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:] 4 CameraUI -[CAMPriorityNotificationCenter removeObserver:] 13 arrow_drop_down libsystem_pthread.dylib start_wqthread Crashed: com.google.firebase.crashlytics.ios.exception SIGABRT ABORT 0x00000001c1eb7334 keyboard_arrow_up 0 FirebaseCrashlytics FIRCLSProcess.c - Line 393 FIRCLSProcessRecordAllThreads + 393 1 FirebaseCrashlytics FIRCLSProcess.c - Line 424 FIRCLSProcessRecordAllThreads + 424 2 FirebaseCrashlytics FIRCLSHandler.m - Line 34 FIRCLSHandler + 34 3 FirebaseCrashlytics FIRCLSException.mm - Line 218 __FIRCLSExceptionRecord_block_invoke + 218 4 libdispatch.dylib _dispatch_client_callout + 20 5 arrow_drop_down libdispatch.dylib _dispatch_lane_barrier_sync_invoke_and_complete + 60 6 FirebaseCrashlytics FIRCLSException.mm - Line 225 FIRCLSExceptionRecord + 225 7 FirebaseCrashlytics FIRCLSException.mm - Line 111 FIRCLSExceptionRecordNSException + 111 8 FirebaseCrashlytics FIRCLSException.mm - Line 279 FIRCLSTerminateHandler() + 279 9 libc++abi.dylib std::__terminate(void (*)()) + 20 24 arrow_drop_down libsystem_pthread.dylib start_wqthread + 8 This started happening in 14.4 and above and was working fine in the previous version and am recently seeing an increase in the crash. Is it an OS or am i doing something wrong
1
0
1.6k
Aug ’21
Issues using UITextInput/UIKeyInput implementation with captureTextFromCamera
Description I'm (trying to) use captureTextFromCamera(sender:) however I'm having issues getting both insertText(text:) and setMarkedText(markedText:, selectedRange:)/unmarkText() to work at the same time. I have attached the relevant portion of the UIView subclass here:UIView subclass and can provide a minimal reproduction project if requested. Details I subclassed UIView and implemented the relevant methods/properties for UITextInput, however I found that while the markedText methods were being called insertText wasn't. I then changed my subclass to declare it's conformance to UIKeyInput instead of UITextInput (didn't change anything else) and now insertText gets called, but setMarkedText/unmarkText no longer get called (as expected). I don't think insertText not being called is expected based on what was said in the session and what I can find online. However I have never worked with these protocols before so I may be misunderstanding how they work. SwiftUI I'm doing this from a SwiftUI app using UIViewRepresentable, and I'm not actually showing the UIView anywhere, just including it in the hierarchy to be able to call captureTextFromCamera and get the relevant protocol methods called to capture the text.
5
0
2k
Jul ’21
Text Capture from Image
The new iOS 15 feature "Capture Text from Image" option comes only after second tap. So The Apple Team provided let textFromCamera = UIAction.captureTextFromCamera(responder: self.notes, identifier: nil) When I tried to use same with SwiftUI, responser object should confirm to UIResponder/UIKeyInpunt. How to use same with SwiftUI or Is there any alternate option in SwiftUI ?
0
0
1.1k
Jun ’21
SwiftUI API for captureTextFromCamera ?
Hi, the video was great and on point, but it only featured UIKit apis. 3 years into the SwiftUI transition, I wonder if this is a UIKit only feature or can we also use it if we chose SwiftUI to build our apps ? Thanks
Replies
3
Boosts
0
Views
2.4k
Activity
Jul ’23
Use Live Text in SwiftUI
Menu {                 Button(action: {                     // TODO: support live text                 }) {                     Label("Live Text", systemImage: "camera.viewfinder")                 }             } label: {                 Text("Hi")             } How can I present the live text view in swiftUI
Replies
1
Boosts
0
Views
1.5k
Activity
Jun ’23
How do I take the camera keyboard
How do I take the camera keyboard off my email app??
Replies
1
Boosts
0
Views
662
Activity
Apr ’22
Type 'CameraPreview' does not conform to protocol 'UIViewRepresentable'
Hi everyone, I'm working on a camera app, but there is an error and I don't know how to fix it. Can anyone help me? Thanks, Robby Flockman
Replies
2
Boosts
0
Views
2.4k
Activity
Jan ’22
Notification service extension not called on flutter iOS
Issue:- When getting remote notification have to show image using the imageurl in payload. In Android it’s working fine once we changed the payload. In iOS image not showing in push notification. Issue facing on Notification Service Extension:- I have added the notification extension and added the code for modifying notification content. This configuration is working fine in native iOS app. Added the same in the flutter iOS project but there it won’t work. While receiving push notification the extension is not getting called. Just receiving normal notification only. I have tried many scenarios to sort out this issue. Still it’s not working. Steps i’ve followed: Added code to get notification permission Added Notification extension to the project Used automatically manage signing for profile configuration Added code to modify notification Added imageURL and mutable-content keys in payload Added the project and payload screenshots here
Replies
1
Boosts
0
Views
2.0k
Activity
Dec ’21
Not getting callback after tapping "Insert text" button in text on camera for UITextField
I have implemented Text on camera feature in two ways UITextField with UITextContentType and UIKeyboardType as emailAddress, which helps to show a button in the keyboard to open the camera for capturing email. UITextField with basic text. I implemented a custom UIButton to open the camera for capturing text for this field. In both cases I'm not getting callback in any of these functions insertText(_ text) setMarkedText(markedText:, selectedRange:) and unmarkText() after user taps Insert Text button. Help me.
Replies
3
Boosts
0
Views
2.1k
Activity
Sep ’21
The LiveText Interface can not dismiss
After calling the function 'captureTextFromCamera:' of an UIResponder-object multiple times, then the LiveText Interface can not be dismissed.
Replies
0
Boosts
0
Views
680
Activity
Aug ’21
Camera UI crash
CameraUI -[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:] i am seeing crashes on firebase and here is the stacktrace Fatal Exception: NSGenericException *** Collection <__NSArrayM: 0x28024a0a0> was mutated while being enumerated. keyboard_arrow_up 0 CoreFoundation __exceptionPreprocess 2 arrow_drop_down CoreFoundation -[__NSSingleObjectEnumerator initWithObject:collection:] arrow_right 3 CameraUI -[CAMPriorityNotificationCenter _removeObserver:fromObserversByName:] 4 CameraUI -[CAMPriorityNotificationCenter removeObserver:] 13 arrow_drop_down libsystem_pthread.dylib start_wqthread Crashed: com.google.firebase.crashlytics.ios.exception SIGABRT ABORT 0x00000001c1eb7334 keyboard_arrow_up 0 FirebaseCrashlytics FIRCLSProcess.c - Line 393 FIRCLSProcessRecordAllThreads + 393 1 FirebaseCrashlytics FIRCLSProcess.c - Line 424 FIRCLSProcessRecordAllThreads + 424 2 FirebaseCrashlytics FIRCLSHandler.m - Line 34 FIRCLSHandler + 34 3 FirebaseCrashlytics FIRCLSException.mm - Line 218 __FIRCLSExceptionRecord_block_invoke + 218 4 libdispatch.dylib _dispatch_client_callout + 20 5 arrow_drop_down libdispatch.dylib _dispatch_lane_barrier_sync_invoke_and_complete + 60 6 FirebaseCrashlytics FIRCLSException.mm - Line 225 FIRCLSExceptionRecord + 225 7 FirebaseCrashlytics FIRCLSException.mm - Line 111 FIRCLSExceptionRecordNSException + 111 8 FirebaseCrashlytics FIRCLSException.mm - Line 279 FIRCLSTerminateHandler() + 279 9 libc++abi.dylib std::__terminate(void (*)()) + 20 24 arrow_drop_down libsystem_pthread.dylib start_wqthread + 8 This started happening in 14.4 and above and was working fine in the previous version and am recently seeing an increase in the crash. Is it an OS or am i doing something wrong
Replies
1
Boosts
0
Views
1.6k
Activity
Aug ’21
Issues using UITextInput/UIKeyInput implementation with captureTextFromCamera
Description I'm (trying to) use captureTextFromCamera(sender:) however I'm having issues getting both insertText(text:) and setMarkedText(markedText:, selectedRange:)/unmarkText() to work at the same time. I have attached the relevant portion of the UIView subclass here:UIView subclass and can provide a minimal reproduction project if requested. Details I subclassed UIView and implemented the relevant methods/properties for UITextInput, however I found that while the markedText methods were being called insertText wasn't. I then changed my subclass to declare it's conformance to UIKeyInput instead of UITextInput (didn't change anything else) and now insertText gets called, but setMarkedText/unmarkText no longer get called (as expected). I don't think insertText not being called is expected based on what was said in the session and what I can find online. However I have never worked with these protocols before so I may be misunderstanding how they work. SwiftUI I'm doing this from a SwiftUI app using UIViewRepresentable, and I'm not actually showing the UIView anywhere, just including it in the hierarchy to be able to call captureTextFromCamera and get the relevant protocol methods called to capture the text.
Replies
5
Boosts
0
Views
2k
Activity
Jul ’21
How to detect when Live Text Camera is presented?
Hello! I'm trying to detect when the Live Text camera "keyboard" is being shown, but didn't find anything in the documentation. I've tried to use UIResponder.keyboardWillShowNotification but without success. Thank you!
Replies
1
Boosts
0
Views
749
Activity
Jul ’21
Text Capture from Image
The new iOS 15 feature "Capture Text from Image" option comes only after second tap. So The Apple Team provided let textFromCamera = UIAction.captureTextFromCamera(responder: self.notes, identifier: nil) When I tried to use same with SwiftUI, responser object should confirm to UIResponder/UIKeyInpunt. How to use same with SwiftUI or Is there any alternate option in SwiftUI ?
Replies
0
Boosts
0
Views
1.1k
Activity
Jun ’21