utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
26.56k stars 1.33k forks source link

Allow rich text in the VM Notes field using Markdown syntax #3547

Open conath opened 2 years ago

conath commented 2 years ago

I would like to be able to write rich notes about my VMs using the Markdown syntax.

This could be implemented by using the AttributedString API introduced by Apple in 2021.

osy commented 2 years ago

Seems like TextEditor does not support AttributedString yet.

conath commented 2 years ago

What I would like is to write markdown in the VM config and then see the formatted text when I select the VM in the list. That should be possible, right?

osy commented 2 years ago

It is possible using Text but Text doesn't provide scrolling so you would have to create a custom view that lets you display the text in a scrollable view. I think Apple should provide an updated API.

conath commented 2 years ago

This seems like it would be easily possible by wrapping UITextView with UIViewRepresentable. I found this Swift Package that implements this.

osy commented 2 years ago

SwiftUI is already extremely fragile and things keep breaking or not working properly even with minor OS updates. I hesitate to add any "custom" SwiftUI controls and would rather wait for an "official" Apple API.