I am using TextEditor with the String type right now but I want to use AttributedString because I want to find every character that starts with a # symbol and mark it a different color using range.
How can I use AttributedString with TextEditor?
struct PlaygroundView: View {
@State private var text = AttributedString("")
var body: some View {
TextEditor(text: text)
}
}
returns to me Cannot convert value of type 'AttributedString' to expected argument type 'Binding<String>'
TextEditordoesn't supportAttributedStringsUITextView