Created
April 18, 2017 23:53
-
-
Save tsraveling/2c7edac4f0607fa553ec5ea458f158cd to your computer and use it in GitHub Desktop.
UITextView delegate
This file contains hidden or 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
| // MARK: - UITextViewDelegate - | |
| func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { | |
| if text == "\n" { | |
| textView.resignFirstResponder() | |
| return false | |
| } | |
| return true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment