proton icon indicating copy to clipboard operation
proton copied to clipboard

Featue request: Add an example of usage with swiftui

Open arcrx opened this issue 3 years ago • 6 comments

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

arcrx avatar Oct 08 '20 03:10 arcrx

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.

rajdeep avatar Oct 09 '20 03:10 rajdeep

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.

vox-humana avatar Oct 09 '20 06:10 vox-humana

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

writing-shed avatar Apr 01 '21 08:04 writing-shed

how can I use Commands and TextProcessor in swiftui

alexwchh avatar Dec 01 '23 14:12 alexwchh

@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.

rajdeep avatar Dec 01 '23 21:12 rajdeep

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.

easiwriter avatar Feb 28 '24 08:02 easiwriter