TextField A custom textfield for one time code in swift Aug 09, 2021 1 min read OneTimeCodeTextField A custom textfield for one time code in swift. Example configuration class ViewController: UIViewController { @IBOutlet weak var codeTxt: OneTimeCodeTextField! override func viewDidLoad() { super.viewDidLoad() // Configure has to be called first codeTxt.configure(withSlotCount: 6, andSpacing: 8) // Default: 6 slots, 8 spacing // Customisation(Optional) codeTxt.codeBackgroundColor = .secondarySystemBackground // Default: .secondarySystemBackground codeTxt.codeTextColor = .label // Default: .label codeTxt.codeFont = .systemFont(ofSize: 30, weight: .black) // Default: .system(ofSize: 24) codeTxt.codeMinimumScaleFactor = 0.2 // Default: 0.8 codeTxt.codeCornerRadius = 12 // Default: 8 codeTxt.codeCornerCurve = .continuous // Default: .continuous codeTxt.codeBorderWidth = 1 // Default: 0 codeTxt.codeBorderColor = .label // Default: .none // Get entered Passcode codeTxt.didReceiveCode = { code in print(code) } // Clear textfield codeTxt.clear() } } Swift GitHub https://github.com/theedov/OneTimeCodeTextField TextField
Masking Easily integrate customizable masked text input fields into SwiftUI apps The MaskedTextFieldSwiftUI package empowers developers to easily integrate customizable masked text input fields into their SwiftUI applications. 02 March 2024
TextField Transparent TextField Inside SwiftUI List This repo reproduces a macOS SwiftUI issue where a TextField inside a List doesn't keep a transparent background while editing. 23 February 2024
Input A small project for creating an input field that is geared towards reusability and accessibility A small project for creating an input field that is geared towards reusability and accessibility 10 October 2023