TextEditor

      

Preview

import TextEditor

struct ContentView: View {
    let richText = NSMutableAttributedString()
    
    var body: some View {
        ZStack {
            Color(hex: "97DBAE")
                .edgesIgnoringSafeArea(.all)
            RichTextEditor(richText: richText)
                .padding(10)
                .background(
                    Rectangle()
                        .stroke(lineWidth: 1)
                )
                .padding()
        }
    }
}

Preview Image

Usage

Add the following lines to your Package.swift or use Xcode “Add Package Dependency” menu.

.package(name: "TextEditor", url: "https://github.com/nothingsh/TextEditor", ...)

Todo

  • Add font selection
  • Make Input Accessory View Configurable

GitHub

View Github