- August 28, 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 deselectedTextViewplaceholder: String? = niltextAlignment: TextView.TextAlignment = .lefttextHorizontalPadding: CGFloat = 0textVerticalPadding: CGFloat = 7placeholderAlignment: Alignment = .topLeadingplaceholderHorizontalPadding: CGFloat = 4.5placeholderVerticalPadding: CGFloat = 7font: UIFont = .preferredFont(forTextStyle: .body)
textColor: UIColor = .blackplaceholderColor: Color = .graybackgroundColor: UIColor = .whitecontentType: TextView.ContentType? = nil
autocorrection: TextView.Autocorrection = .defaultautocapitalization: TextView.Autocapitalization = .sentencesisSecure: Bool = falseisEditable: Bool = trueisSelectable: Bool = trueisScrollingEnabled: Bool = trueisUserInteractionEnabled: Bool = trueshouldWaitUntilCommit: 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”
)
}
}
}
This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide ...
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or ...
Create Toast Views with Minimal Effort in SwiftUI Using SSToastMessage. SSToastMessage enables you to effortlessly add toast notifications, alerts, and ...