Adopt desktop class editing interactions

RSS for tag

Discuss the WWDC22 Session Adopt desktop class editing interactions

Posts under wwdc2022-10071 tag

9 Posts

Post

Replies

Boosts

Views

Activity

Adopt UIFindInteraction across multiple views
We are currently trying to adopt the newly introduced find bar in our app. The app: The app is a text editor with a main text view. However it includes nested views (for text like footnotes) that are presented as modal sheets. So you tap on the footnote within the main text, a form sheet is presented with the contents of the footnote ready to be edited. We have an existing search implementation, but are eager to move to the system-provided UI. Connecting the find bar through a custom UIFindSession with our existing implementation is working without any issues. The Problem: Searching for text does not only work in the main text view, but also nested text (like footnotes). Let's say I have a text containing the word "iPhone" both in the main text and the footnote. In our existing implementation, stepping from the search match to the next one would open the modal and highlight the match in the nested text. The keyboard would stay open. With the new UIFindInteraction this is not working however. As soon as a modal form sheet is presented, the find interaction closes. By looking at the stack trace I can see a private class called UIInputWindowController that cleans up input accessory views after the modal gets presented. I believe it is causing the find panel to give up its first responder state. I noticed that opening popovers appears to be working fine. Is there a way to alter the presentation of the nested text so that the view is either not modal or able to preserve the current find session? Or is this unsupported behavior and we should try and look for a different way? The thing that really confuses me is that this appears to work without issue in Notes.app. There the find bar is implemented as well. There are multiple views that can be presented while the find bar is open. Move Note is one of them. The view appears as a modal sheet. It keeps the find bar open and active, though its tint color matches the deactivated one of the main Notes view. The find bar is still functional with the text field being active and the overlay updating in the background. This behavior appears to be a bug in the Notes app, but is exactly what we want for our use case. I attached some images: Two are from the Notes app, two from a test project demonstrating the problem. Opening a modal view closes the find bar there.
2
0
1.4k
Jan ’25
Providing in-note text search (UIFindInteraction) feature in iOS 15
I would like to implement in-note text search feature, as found in Apple's Notes, Apple's Safari app. It looks like the following I understand that such an API is called UIFindInteraction, and only available in iOS16. https://developer.apple.com/documentation/uikit/uifindinteraction WWDC 2022: Adopt desktop-class editing interactions However, my app is targeting iOS 15. I was wondering, is it possible for us to provide same feature, in iOS 15? Thank you.
0
0
974
Feb ’23
UIFindInteraction UI is not usable when Stage Manager is enabled
I have a problem with presenting the new find panel in an iPad app when Stage Manager is enabled. This happens both on device as well as in Simulator. The problem is that UIFindInteraction’s find panel only flicks (appears and disappears in a fraction of second) and thus is not usable for actually searching anything. Presumably, this is a UIKit bug. Has anyone found a way around it? I'm attaching a link to a demo project that does nothing special: setting isFindInteractionEnabled = true on a UITextView preseting the find panel via textView.findInteraction?.presentFindNavigator(showingReplace: false) https://github.com/tomaskraina/feedbackassistant.apple.com/tree/master/UIFindInteraction-StageManager-UIKit
5
0
1.6k
Sep ’22
SwiftUI Support
How to add a custom button to the Edit Menu on both iOS and iPadOS natively using SwiftUI. I have seen many ways to implement custom button using UIKit but wondering how to use SwiftUI to achieve the same thing. I have never seen any modifiers or Menus about this. I guest there is no way to do that. Any idea about this? or is it a future update for SwiftUI ??
4
0
2.3k
Aug ’22
Using UIEditMenuInteraction instead of UIMenuController.shared.menuItems
I don't really understand what they explained on how to add an item to the menu with a function (who does the function returns the UIMenu to?, where do I get the Range or the suggestedActions from?), perhaps because I'm using SwiftUI. Right now I'm using: UIMenuController.shared.menuItems = [UIMenuItem(title: "Search" , action: #selector(webView.search))] to add an item to the context menu of my WKWebView. what is the equivalent of that with UIEditMenuInteraction?
0
3
1.2k
Aug ’22
Adopt UIFindInteraction across multiple views
We are currently trying to adopt the newly introduced find bar in our app. The app: The app is a text editor with a main text view. However it includes nested views (for text like footnotes) that are presented as modal sheets. So you tap on the footnote within the main text, a form sheet is presented with the contents of the footnote ready to be edited. We have an existing search implementation, but are eager to move to the system-provided UI. Connecting the find bar through a custom UIFindSession with our existing implementation is working without any issues. The Problem: Searching for text does not only work in the main text view, but also nested text (like footnotes). Let's say I have a text containing the word "iPhone" both in the main text and the footnote. In our existing implementation, stepping from the search match to the next one would open the modal and highlight the match in the nested text. The keyboard would stay open. With the new UIFindInteraction this is not working however. As soon as a modal form sheet is presented, the find interaction closes. By looking at the stack trace I can see a private class called UIInputWindowController that cleans up input accessory views after the modal gets presented. I believe it is causing the find panel to give up its first responder state. I noticed that opening popovers appears to be working fine. Is there a way to alter the presentation of the nested text so that the view is either not modal or able to preserve the current find session? Or is this unsupported behavior and we should try and look for a different way? The thing that really confuses me is that this appears to work without issue in Notes.app. There the find bar is implemented as well. There are multiple views that can be presented while the find bar is open. Move Note is one of them. The view appears as a modal sheet. It keeps the find bar open and active, though its tint color matches the deactivated one of the main Notes view. The find bar is still functional with the text field being active and the overlay updating in the background. This behavior appears to be a bug in the Notes app, but is exactly what we want for our use case. I attached some images: Two are from the Notes app, two from a test project demonstrating the problem. Opening a modal view closes the find bar there.
Replies
2
Boosts
0
Views
1.4k
Activity
Jan ’25
Providing in-note text search (UIFindInteraction) feature in iOS 15
I would like to implement in-note text search feature, as found in Apple's Notes, Apple's Safari app. It looks like the following I understand that such an API is called UIFindInteraction, and only available in iOS16. https://developer.apple.com/documentation/uikit/uifindinteraction WWDC 2022: Adopt desktop-class editing interactions However, my app is targeting iOS 15. I was wondering, is it possible for us to provide same feature, in iOS 15? Thank you.
Replies
0
Boosts
0
Views
974
Activity
Feb ’23
Custom webView menu
I want to delete some suggestedActions and add custom menu when select text in webView in iOS 16. How can I do it with UIEditMenuInteraction? Before I use canPerformAction + UIMenuController
Replies
4
Boosts
1
Views
1.7k
Activity
Oct ’22
Custom UlAction could not insert into menu in PdfView
TextView has a function: func textView(_ textView: UITextView, editMenuForTextin range: NSRange, suggestedActions: [UIMenuElement]) -> UIMenu? {... } to add custom UlAction into context menu. But PdfKit has no way to insert a custom UlAction into the context menu popped up by long press on PdfView page.
Replies
1
Boosts
1
Views
1.7k
Activity
Oct ’22
Customize menu : Using UIEditMenuInteraction in WKWebView (iOS 16)
I want to add custom menu when select text in WKWebView in iOS 16 with Xcode 14. How can I do it with UIEditMenuInteraction? Before I used canPerformAction + UIMenuController
Replies
2
Boosts
4
Views
1.5k
Activity
Sep ’22
UIFindInteraction UI is not usable when Stage Manager is enabled
I have a problem with presenting the new find panel in an iPad app when Stage Manager is enabled. This happens both on device as well as in Simulator. The problem is that UIFindInteraction’s find panel only flicks (appears and disappears in a fraction of second) and thus is not usable for actually searching anything. Presumably, this is a UIKit bug. Has anyone found a way around it? I'm attaching a link to a demo project that does nothing special: setting isFindInteractionEnabled = true on a UITextView preseting the find panel via textView.findInteraction?.presentFindNavigator(showingReplace: false) https://github.com/tomaskraina/feedbackassistant.apple.com/tree/master/UIFindInteraction-StageManager-UIKit
Replies
5
Boosts
0
Views
1.6k
Activity
Sep ’22
SwiftUI Support
How to add a custom button to the Edit Menu on both iOS and iPadOS natively using SwiftUI. I have seen many ways to implement custom button using UIKit but wondering how to use SwiftUI to achieve the same thing. I have never seen any modifiers or Menus about this. I guest there is no way to do that. Any idea about this? or is it a future update for SwiftUI ??
Replies
4
Boosts
0
Views
2.3k
Activity
Aug ’22
Using UIEditMenuInteraction instead of UIMenuController.shared.menuItems
I don't really understand what they explained on how to add an item to the menu with a function (who does the function returns the UIMenu to?, where do I get the Range or the suggestedActions from?), perhaps because I'm using SwiftUI. Right now I'm using: UIMenuController.shared.menuItems = [UIMenuItem(title: "Search" , action: #selector(webView.search))] to add an item to the context menu of my WKWebView. what is the equivalent of that with UIEditMenuInteraction?
Replies
0
Boosts
3
Views
1.2k
Activity
Aug ’22
Replace option not available for WKWebView in Find and Replace
For editable WKWebView replace option is not coming after enabled the findInteraction and presenting findNavigator with showingReplace true. The same option working fine for UITextview.
Replies
0
Boosts
0
Views
1.8k
Activity
Aug ’22