Questions tagged [uitextviewdelegate]

A text view delegate responds to editing-related messages from the text view. You can use the delegate to track changes to the text itself and to the current selection.

A text view delegate responds to editing-related messages from the text view. You can use the delegate to track changes to the text itself and to the current selection.

@property(nonatomic, assign) id<UITextViewDelegate> delegate

Available in iOS 2.0 and later.

225 questions
0
votes
1 answer

What main difference textFieldDidChange and shouldChangeCharactersIn method, the delegate of UITextFieldDelegate?

Can someone explain about when to use and how difference of them ?.
Nawin P.
  • 223
  • 1
  • 4
  • 11
0
votes
4 answers

SWIFT iOS - Get text from multi-line uitextview with line breaks as they are visible on the screen

I have a multi-line UITextView and sometimes the text wraps several lines. I want to get the text from it with line breaks from what is visible on the iphone screen. This is useful because I have a UITextView that changes font size with the UI and I…
MaxSped
  • 117
  • 1
  • 1
  • 15
0
votes
0 answers

NSAttributedString.Key,Link not working on ios 11.4

I have a UITextView that works great in iOS 12 and 13 but not on iOS 11.4 and below. This textView has a text that 2 parts need to be clickable and open a webview (the common Privacy Policy and Terms & Conditions text). let attributedLegalString =…
Joan Cardona
  • 3,463
  • 2
  • 25
  • 43
0
votes
0 answers

How to add text bubble styles when I separate the email address by comma as show in the screen shot attached

Hi I'm new to iOS app development. I am implemented an UITextview to add multiple address separated by comma I need to apply a style bubble when user separates the email by pressing comma or space or done button (in the keyboard.) reference screen…
Swiosift
  • 143
  • 2
  • 14
0
votes
2 answers

Toggle Enabling UITextView Scroll After Max Number of Lines

I have a uitextview subview in an inputContainerView as it may appear in a messaging app. Programmatically, on load, the height anchor of the uitextview is set when the inputContainerView is initialized. This constraint works great in increasing the…
Chris
  • 431
  • 8
  • 33
0
votes
1 answer

How to know the pressed key in the keyboard in iPhone

I am new to iPhone. I'd like to know the key pressed in the keyboard, and instead of the letter of the key I'd like to insert another letter in UITextView. So for this are there any methods which will be called when a key is pressed in the key…
0
votes
1 answer

UITextView delegate shouldChangeTextInRange isn't called when keyboard is selected to Chinese (Simplified) - Handwriting in Swift 4.2

Here is my Sample Code: class ViewController: UIViewController, UITextViewDelegate { @IBOutlet weak var textView_editingView: UITextView! override func viewDidLoad() { super.viewDidLoad() textView_editingView.text = "" …
0
votes
1 answer

Delegate protocol functions not triggered for UITextView

I have this swift file where I'm trying to create a custom class to handle placeholders for multiple text views on one page. I prefer a separate class because I think its cleaner to handle multiple views. Problem is, the functions…
Maxwell Omdal
  • 172
  • 3
  • 14
0
votes
2 answers

How can I prevent a user from adding too many line breaks in a UITextView in Swift 5?

I have a UITextView to let users type-in comments for some audio file they have just recorded. I would like to limit the amount of the "\n" (newline characters) they can use to 5 (i.e., the comment should be up to 5 lines long). If they try going…
0
votes
1 answer

How do I implement mention of users after @ (AT) as in Twitter or WhatsApp?

Help me please implement UITextView, which will be able to recognise @. When I'm typing characters of the username required after @, there is filtered tableView with the username appearing, in which I click on çell and username is inserted in the…
0
votes
1 answer

dynamic textview with arabic text entry

I am using a dynamic textview. func textViewDidChange(_ textView: UITextView) { let str = textView.text! as NSString let size = str.size(attributes: [NSFontAttributeName: UIFont.systemFont(ofSize: 20.0)]) textView.frame =…
Faheem Rahman
  • 343
  • 2
  • 10
0
votes
1 answer

Extra space is added at the bottom of text in uitextview when string is pasted into it

When i am pasting the text in UITextView then some extra space is getting added into it. But when i scroll it then the textView is fitted according to the content. In textViewDidChange, textView height constraint is being set according to its…
cherry_4
  • 158
  • 2
  • 17
0
votes
1 answer

TextView Counter On Typing And Count New Line Swift IOS

I want to count newlines ("\n") in a textview. Or, more specifically, I want to make textview box to count the characters when typing ( +1 ) in label. Also count ( +2 ) when the text have new line and counter ( Label ) must be continuous. Here is my…
0
votes
1 answer

NSRegularExpressions performance on UITextView

I'm currently working with NSRegularExpressions (regex), which I'm building a markdown regex. I think that my approach on the way to change the text that matches the regex isn't the best one, and here's why. I have created the following, as…
Ivan Cantarino
  • 3,058
  • 4
  • 34
  • 73
0
votes
1 answer

Detect taps of links/numbers in UITextView

theres no way to detect weather the user taped on a phone number and/or link in a UITextView is there? There doesn't seem to be a delegate method for it. Any ideas?
Sam Jarman
  • 7,277
  • 15
  • 55
  • 100