SwiftUI custom bordered text field with placeholder text in border.
This control can be used in following different ways
BorderedTextField(placeHolder: .constant("TextField Editable"), text: $text)
BorderedTextField(placeHolder: .constant("TextField Non Editable"), text: $text, isEditingEnabled: false)
BorderedTextField(placeHolder: .constant("Password Field"), text: $text, isSecureField: true)
BorderedTextField(placeHolder: .constant("Hide PlaceHolder"), text: $text, showBorderPlaceHolder: false, highlightColor: Color.green)
BorderedTextField(placeHolder: .constant("Change Border Color"), text: $text, borderColor: Color.red)
BorderedTextField(placeHolder: .constant("Focus Highlight Color "), text: $text, borderColor: Color.red, highlightColor: Color.green)
Currently BorderedTextField is only avaliable via Swift Package Manager. You can also add manually to your project.
If you have already Swift package set up, add BorderedTextField as a dependency to your dependencies in your Package.swift file.
dependencies: [
.package(url: "https://github.com/KrishnaRLolage/BorderedTextField.git")
]