Make Floating Textfield in iOS
Suppose you want that when you are typing a text on UITexfield its placeholder goes above, but this is not a by the default property of iOS. To use Floating TextField in iOS you have to use the JVFloatLabeledTextField library. You can download the JVFloatLabeledTextField library from this link (https://github.com/jverdi/JVFloatLabeledTextField).If you are creatingUITexfield from storyboard you have to pass the JVFloatLabeledTextField in the class If you are creating theUITexfield programmatically follow this code :-
1 2 3 4 5 6 |
let newsletterTextField = JVFloatLabeledTextField(frame: CGRect(x: 5, y: self.venY, width: SCREEN_WIDTH - 15, height: 50)) newsletterTextField.placeholder = "Profile Name" newsletterTextField.tintColor = UIColor().HexToColor(hexString: primary_color) newsletterTextField.text = self.profileNames[0] self.multivenderView.addSubview(newsletterTextField) newsletterTextField.tag = 2200 |