- August 20, 2025
- Mins Read
https://github.com/kenmueller/TextView
for the package repository URLtext: Binding<String>
isEditing: Binding<Bool>
TextView
will modify the value when it is selected and deselectedTextView
placeholder: String? = nil
textAlignment: TextView.TextAlignment = .left
textHorizontalPadding: CGFloat = 0
textVerticalPadding: CGFloat = 7
placeholderAlignment: Alignment = .topLeading
placeholderHorizontalPadding: CGFloat = 4.5
placeholderVerticalPadding: CGFloat = 7
font: UIFont = .preferredFont(forTextStyle: .body)
textColor: UIColor = .black
placeholderColor: Color = .gray
backgroundColor: UIColor = .white
contentType: TextView.ContentType? = nil
autocorrection: TextView.Autocorrection = .default
autocapitalization: TextView.Autocapitalization = .sentences
isSecure: Bool = false
isEditable: Bool = true
isSelectable: Bool = true
isScrollingEnabled: Bool = true
isUserInteractionEnabled: Bool = true
shouldWaitUntilCommit: Bool = true
false
would make the TextView
completely unusable.shouldChange: TextView.ShouldChangeHandler? = nil
(NSRange, String) -> Bool
and is called with the arguments to textView(_:shouldChangeTextIn:replacementText:)
.
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”
)
}
}
}
A better TextField for SwiftUI. A growing, multiline, auto-focusable TextField supporting bindable focus. This has been pulled out of my ...
Format phone numbers as they're typed—entirely in SwiftUI. 📱 Get Started | Examples | Customize | Features | Install | Pricing And it's as easy as
CurrencyText provides lightweight libraries for formating text field text as currency, available for both UIKit and SwiftUI. Its main core, the CurrencyFormatter class, can also ...