Created
March 15, 2017 20:40
-
-
Save MylesCaley/4f5f506a52ad0c3dd0aeafd2e0413768 to your computer and use it in GitHub Desktop.
blink cursor in textfield without showing keyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// force blinking the cursor | |
self!.inputTextField.inputView = UIView() | |
self!.inputTextField.becomeFirstResponder() | |
//re-enable for when user actually clicks | |
inputTextField.rx.controlEvent(.touchDown).subscribe(onNext: { [weak self] _ in | |
guard let _ = self else { return } | |
self!.inputTextField.inputView = nil | |
self!.inputTextField.reloadInputViews() | |
}).addDisposableTo(rx_disposeBag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
put it under your viewload and for swift 5
note change inputTextField to the your input variable name