import TextEditor
struct ContentView: View {
let richText = NSMutableAttributedString()
var body: some View {
ZStack {
Color(hex: "97DBAE")
.edgesIgnoringSafeArea(.all)
RichTextEditor(richText: richText) { _ in
// try to save edited rich text here
}
.padding(10)
.background(
Rectangle()
.stroke(lineWidth: 1)
)
.padding()
}
}
}
Add the following lines to your Package.swift
or use Xcode "Add Package Dependency" menu.
.package(name: "TextEditor", url: "https://github.com/nothingsh/TextEditor", ...)
- Add font selection
- Make Input Accessory View Configurable