Installation can be done using Swift Package Manager. In Xcode, go to File > Swift Packages > Add Package Dependency… and paste the repository URL (https://github.com/flowbe/MaterialOutlinedTextField) to add it.
You can also add the dependency directly in your Package.swift file:
MaterialOutlinedTextField
A simple Material Design outlined text field implementation in Swift.
Installation
Installation can be done using Swift Package Manager. In Xcode, go to File > Swift Packages > Add Package Dependency… and paste the repository URL (https://github.com/flowbe/MaterialOutlinedTextField) to add it.
You can also add the dependency directly in your
Package.swift
file:Usage
MaterialOutlinedTextField
has the same interface asUITextField
with a few extra properties and methods:label
: The label appearing as floating or placeholder. You can use this property to set his text content.labelBehavior
: Defines the behavior of the label when the text field is editing. The possible values arefloats
(default) ordisappears
.containerRadius
: The corner radius of the text field.colorModel
: The current color model based on the current state (get-only).outlineLineWidth
: The current outline line width model based on the current state (get-only).setColorModel(_ colorModel: ColorModel, for state: State)
: Set the color model for the specified state.setOutlineLineWidth(_ outlineLineWidth: CGFloat, for state: State)
: Set the color model for the specified state.Example