DNMeterialTextField
DNMeterialTextFiled
This TextFiled is created using Swift languagge and this is available iOS , inspired by Material Design , Android EditText
com.google.android.material.textfield.TextInputEditText
With icons
Without icons
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Platform : iOS , Swift 4.3+
Installation
DNMeterialTextField is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'DNMeterialTextField'
Uses
-
DNMeterialTextField
connect this file to your TextField in Storyboard . -
Using code :
let textField = DNMeterialTextField(frame: CGRect(x: 0, y: 0, width: 200.00, height: 40.00)) textField.borderStyle = .none //important textField.placeholder = "Enter Email" self.view.addSubview(textField)
Customize
Inspectable Properties (Storyboard)
none
(4th in image)
Border Style Must be set to
Modify using code :
-
Change roundness
self.textField.cornerRadius = 10.0
-
Change Active Color
self.textField.activeBorderColor = UIColor.orange
-
Change InAcitve Color
self.textField.inactiveColor = .darkGray
-
Change Left Side icon ( set nil to remove icon default = nil )
self.textField.leftSideIcon = UIImage(named:”ic_user”)
Author
Dhiru-Dev, [email protected]
StackOvrflow
License
DNMeterialTextField is available under the MIT license. See the LICENSE file for more info.