Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 992 Bytes

README.md

File metadata and controls

42 lines (28 loc) · 992 Bytes

MDEditor (In development)

Markdown editor and viewer in Swift, text rendering and processing by using Textkit2, and use swift-markdown as markdown-gfm parsing tool

Support platform:

Usage

import SwiftUI
import MDEditor

struct ContentView: View {
    @State private var text: String = """
    # Title

    paragraph
    """

    @State private var isEditable: Bool = true

    var body: some View {
        ZStack {
            MDEditor(text: $text, isEditable: $isEditable)
        }
    }
}

Inspiration

  • The Meet Textkit2 talk gives explanation of how text rendered and processed, and the details about how to use Textkit2

  • STTextView implemented the code editor view based on Textkit2

License

Apache v2