Skip to content

sunlongngy/DummyTextField

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DummyTextField

Custom textfield design with title on the top.

Screenshots

Default When error
normal error

Installation

pod "DummyTextField"

Initialize

let dummyTextField: DummyTextField = {
    let textfield = DummyTextField()
    textfield.setupBorder(
        color   : .lightGray,
        width   : 1,
        radius  : 4
    )
    textfield.setupTitle(
        text        : "Username",
        textColor   : .gray,
        font        : UIFont.systemFont(ofSize: 12, weight: .regular)
    )
    return textfield
}()

Error message

dummyTextField.errorMessage = "Please fill username"

Reset error

dummyTextField.errorMessage = nil