2

I have to make bottomline view colorful when i am trying to update my textfield. After leaving that box color of line should take default color.I tried this but not works for all fields.I have set delegate of textfield also.

 func textFieldDidBeginEditing(_ textField: UITextField) {
    self.titleLine.backgroundColor = #colorLiteral(red: 1, green: 0.386627968, blue: 0.209040308, alpha: 1)
}

taskImage

blackstorm
  • 60
  • 10

2 Answers2

1

You can add another delegate method and set the tag:

func textFieldDidEndEditing(_ textField: UITextField) {
    if textField.tag == 100 {
       self.titleLine.backgroundColor = // your default colour
    } 
}

It may helps to you.thank you.

pacification
  • 5,838
  • 4
  • 29
  • 51
Sanjukta
  • 1,057
  • 6
  • 16
0

you can use SkyFloatingLabelTextField library.it may helps you

amisha.beladiya
  • 363
  • 1
  • 12