Post

Replies

Boosts

Views

Activity

Scroll TextEditor to cursor position
Hello. Is there a good SwiftUI approach on getting the TextEditor cursor position? I have a TextEditor and sometimes when we have a longer text inside it, the cursor is not seen because the keyboard is above covering the bottom of the TextEditor. I would like to somehow detect the position of the cursor, and if it's on the last line of the TextEditor, scroll to the bottom. I've already checked a bit and didn't find any good method of doing this in SwiftUI. If you have any ideas on how to do this, or even a different method any help would be highly appreciated. Thank you!
1
3
807
Oct ’25
Hi community. I am interested on how to block user interaction behind a SwiftUI Menu
Hello, I am trying to achieve the functionality that currently exists in the Photos native iOS app. In Photos, when you open an album, then open the top right menu, the background interaction is disabled (e.g. when tapping on any photo from behind, back button, or nav bar, there will be no action). When using a simple Menu view in SwiftUI and you have any tappable view behind, and you tap on it, the interaction will take place. I checked the documentation and tried to find some modifiers or something that would help me, but found nothing. Do you have any ideea on a good approach for achieving this functionality? Since it was possible on the native apps, I would expect something can be done. Thank you!
0
0
257
Jan ’24