TextEditor

main

Rich Text Editor for iOS (SwiftUI)
nothingsh/TextEditor

TextEditor

      

Preview

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()
        }
    }
}

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

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Mar 10 2025 10:08:33 GMT-0900 (Hawaii-Aleutian Daylight Time)