Skip to content

Commit d2e71fa

Browse files
authored
Update README.md
1 parent 455e40f commit d2e71fa

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
floatingLabelTextField.updateSecureLine(to: .max, text: "Some description", color: .red)
3131

3232
// Check if current mode is secure
33-
floatingLabelTextField.isSecure()
33+
floatingLabelTextField.isSecure
3434

3535
// Change the keyboard type
3636
floatingLabelTextField.setKeyboardType(.emailAddress)
@@ -44,29 +44,33 @@
4444
floatingLabelTextField.headerColor = .green
4545
floatingLabelTextField.placeholderText = "Placeholder"
4646
floatingLabelTextField.placeholderColor = .red
47+
floatingLabelTextField.selectionColor = .red
48+
floatingLabelTextField.textColor = .white
4749
}
4850

4951
override func viewDidAppear(_ animated: Bool) {
5052
super.viewDidAppear(animated)
5153

5254
// Update text once view has been loaded
53-
floatingLabelTextField.setText("Some text")
55+
floatingLabelTextField.text = "Some text"
5456

5557
// Get inputted text whenever you want
56-
floatingLabelTextField.getText()
58+
floatingLabelTextField.text
5759
}
5860

5961
```
6062

6163
Also you can configure style via Interface Builder
6264

6365
```swift
64-
@IBInspectable var separatorColor: UIColor?
66+
@IBInspectable var separatorColor: UIColor
6567
@IBInspectable var headerColor: UIColor
6668
@IBInspectable var headerText: String?
6769
@IBInspectable var placeholderColor: UIColor
6870
@IBInspectable var placeholderText: String?
69-
@IBInspectable var isSecure: Bool = true
71+
@IBInspectable var textColor: UIColor
72+
@IBInspectable var selectionColor: UIColor
73+
@IBInspectable var isSecure: Bool
7074
```
7175

7276
##### Delegate
@@ -75,7 +79,7 @@ Also you can configure style via Interface Builder
7579
extension ViewController: FloatingLabelTextFieldDelegate {
7680

7781
func state(for floatingTextField: FloatingLabelTextField) -> (state: InputTextState, description: String?, color: UIColor) {
78-
let textLength = floatingTextField.getText().count
82+
let textLength = floatingTextField.text.count
7983
switch textLength {
8084
case 1...2: return (.invalid, "Invalid", UIColor(hex: "ff3f4c"))
8185
case 3...5: return (.unreliable, "Unreliable", UIColor(hex: "ff793f"))

0 commit comments

Comments
 (0)