rajdeep / proton

Purely native and extensible rich text editor for iOS and macOS Catalyst apps
Other
1.27k stars 81 forks source link

Featue request: Add an example of usage with swiftui #68

Open arcrx opened 3 years ago

arcrx commented 3 years ago

How could I use proton in a swiftui based macos app? It would be great if there's such an example.

rajdeep commented 3 years ago

That's an interesting question. I have not started looking into integration with SwiftUI yet. Though I do plan to try that out in future, unfortunately it's not in one of the immediate priorities.

Keep an eye out for updates on this issue. Hopefully, I'll be able to make time to at least try it out.

vox-humana commented 3 years ago

Proton is iOS library based on UIKit. Thus, you can't use it natively on macOS. Well, except in macCatalyst, but I assume it wasn't the question. For using in SwiftUI on iOS (and macCatalyst) UIViewRepresentable should help.

writing-shed commented 3 years ago

I've got it working with SwiftUI using UIViewRepresentable. It's quite straightforward.

alexwchh commented 10 months ago

how can I use Commands and TextProcessor in swiftui

rajdeep commented 10 months ago

@alexwchh, Command and TextProcessor work off the EditorView. You can wrap EditorView in SwiftUI using UIViewRepresentable and use the same. These are not directly usable in SwiftUI as such.

easiwriter commented 7 months ago

I have been developing an app using SwiftUI with Proton since early 2021. You need to create a Multiplatform Document App, then It will work on iOS, iPadOS and MacOS. As I said in an earlier post you should interface to Proton using UIViewRepresentable. I would like to use SwiftData so I don't need Coredata, but I've hit a number of problems, so have put that on the back burner for now.