-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example of using editorInputAccessoryView to Example SwiftUI #6
Comments
A little update. I got the buttons to recognize being tapped. But a lot of the TextAttributes functionality doesn't seem to work right. Below is code that will add just a bold button. When I select text and press bold it is very jittery and doesn't bold the text. It will cause any new text I write to be bolded.
This is based on the code found in Example iOS, but made to work better with SwiftUI.
This is a modified version of the ToolbarAction found in Example iOS. this one only contains bold.
If you see what i am doing wrong please let me know. |
Hi @ChaseHaymond, You are right, using an Input Accessory View with SwiftUI can be a bit tricky. You can see what I've done for Infomaniak Mail : So far for your code, this is what I can say about it: |
@valentinperignon Is there any update on updating the editorInputAccessoryView in the SwiftUI Example? We are seriously considering adopting swift-rich-html-editor in place of our current usage of Aztec (which the Aztec team does not seem to want to update). We have gotten the editor basically working but adding formatting tool buttons has been confusing. The links you listed from the Infomaniak Mail repo are 404. And trying to separate the essence to just adding a simple tool button from the rest of the KMail app repo code is a bit fuzzy because it seems to be a bit UIKit-centric. |
I have been trying to get editorInputAccessoryView to work with my SwiftUI code for an app on iOS. I can't get the buttons in the UIView I create to work. Can you add an example to 'Example SwiftUI' that uses editorInputAccessoryView?
I tried using similar code to what 'Example iOS' uses in setupToolbar(). I was able to get the buttons to appear in the toolbar, but I couldn't get them to do anything when pressed.
I'm not sure what I am doing wrong, and I would love if the example code showed a way to use editorInputAccessoryView with SwiftUI.
The text was updated successfully, but these errors were encountered: