I am new to swift.I want to delete white space and also delete new line white space from TextView.So please advice.
Thanks in advance.
I am new to swift.I want to delete white space and also delete new line white space from TextView.So please advice.
Thanks in advance.
For new line or when the enter button is pressed you can use the delegate method
func textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Booladd this to the method
if text == "\n" { self.view.endEditing(true) return false }For whitespace in the end use the below code.
Hope it helps.