kenmueller / TextView

The missing TextView in SwiftUI
MIT License
246 stars 32 forks source link

TextView

The missing TextView in SwiftUI

Download

Inputs

Example

import SwiftUI
import TextView

struct ContentView: View {
    @State var text = ""
    @State var isEditing = false

    var body: some View {
        VStack {
            Button(action: {
                self.isEditing.toggle()
            }) {
                Text("\(isEditing ? "Stop" : "Start") editing")
            }
            TextView(
                text: $text,
                isEditing: $isEditing,
                placeholder: "Enter text here"
            )
        }
    }
}

You might also find these useful...