Skip to content

Customize UITextView with bottom line and title floating

License

Notifications You must be signed in to change notification settings

longhoang2984/LHTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LHTextView

Customize UITextView with bottom line and title floating

To detect user action please using:
   lhTextview.behavior = self

You can use UIStoryBoard to customize your textview or using code as below:

lhTextView.titleColor = .purple
lhTextView.activeTitleColor = .blue
lhTextView.lineViewColor = .lightGray
lhTextView.activeLineViewColor = .blue
lhTextView.errorColor = .red
lhTextView.title = "Demo"
lhTextView.placeholder = "Placeholder"
lhTextView.defaultHeight = 30
lhTextView.lineViewHeight = 1
lhTextView.isLTRLanguage = true
lhTextView.errorFont = UIFont.boldSystemFont(ofSize: 13)
lhTextView.titleFont = UIFont.italicSystemFont(ofSize: 13)
lhTextView.placeHolderFont = UIFont.systemFont(ofSize: 13)

Show Error:

func textViewDidChange(_ textView: UITextView) {
   if let int = Int(textView.text) {
      lhTextView.errorMsg = ""
   }else {
      lhTextView.errorMsg = "Error"
   }
}

***Note: Please don't use textview.delegate

About

Customize UITextView with bottom line and title floating

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages