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
4
votes
1 answer

Open link in UITextView within App

I'm trying to open a link that my UITextView recognizes within the app. I'm using the UITextView delegate method shouldInteractWithURL to achieve this. My code seems to work fine for the in app loading of the url; however, it is still opening the…
ad121
  • 2,268
  • 1
  • 18
  • 24
4
votes
3 answers

Disable autocorrect after typing words with "@" prefix then reenable when new word is typed

In my text view I would like autocorrect to be disabled when typing words that start with "@". The reason being is because I have a tableview menu that popups and suggests usernames. If a username is selected the current text is replaced with a…
denvdancsk
  • 3,033
  • 2
  • 26
  • 41
4
votes
3 answers

Resizing UITextView does not work correctly on first 2 characters of a new line

I have a UITextView called messageTextView, that is a subview of a UIView that I call messageFieldContainer. I need to resize both my UITextView and the container UIView as the user types in more characters into the UITextView. Here is the current…
user3344977
  • 3,584
  • 4
  • 32
  • 88
4
votes
2 answers

UITextView delegate method textViewDidChangeSelection not getting called when returning from background

My ViewController implements UITextView delegate method textViewDidChangeSelection. Everything works just as expected when testing it. However, if the app is put in the background, and then becomes active again, the delegate method is not getting…
empee
  • 151
  • 1
  • 8
4
votes
2 answers

UITextField shouldChangeTextInRange with attributedText causes scroll strange behaviour

I need to capture the typed text, before rendering, in order to apply some attributes to it. For that i'm using the delegate method shouldChangeTextInRange of the UITextView along with the NSAttributedString. So far so good, and it works. The…
3
votes
2 answers

UITextView delegate method textView:shouldChangeTextInRange:replacementText: gives erroneous replacementText on fast delete

I have a UITextView and I am recording all the text view change events into an array. When the user is fast deleting (holding down the delete key so words at deleted at a time and not just one character), when the…
cncool
  • 1,015
  • 11
  • 12
3
votes
0 answers

Cursor position jumps when typing fast in UITextView

I have UITextView in app, Its used like text editor app. When typing long text and typing fast textview cursor position behave weird, its jumping like typewriter. You can find GIF from below link. On typing every word API is calling to check word…
Dipen STL
  • 41
  • 3
3
votes
5 answers

highlighting the text inside the textfield

I want the text inside the textfield to be highlighted when I tap on it. I want the original text to be deleted the moment someone tap on the numberpad. I tried using clearButtonMode but then since my textfield size is very small the cross icon…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
3
votes
4 answers

unable to scroll the textview in Swift

I have a TextView as shown below I am not able to scroll the text view , I have added UITextViewDelegate in UIViewController class as well as set isUserInteractionEnabled property in textViewDidBeginEditing func textViewDidBeginEditing(_ textView:…
Amarjit Dhillon
  • 2,718
  • 3
  • 23
  • 62
3
votes
1 answer

UITextView make application crash when becomeFirstResponder called

I have a UITextView in a UIView. When viewLoad, I had a UIPickerView within a UIAlertView with "OK" button. When I select any value from picker and click "OK" I required to make UITextView active. For that I have written [
Er. Vihar
  • 1,495
  • 1
  • 15
  • 29
3
votes
1 answer

How can I completely remove the hide/done button from a keyboard in a swift app?

I have a following code: textView.returnKeyType = UIReturnKeyType.Done that makes my keyboard look like this: but I would like to get rid of the done/return button and achieve this: what's the best way of doing it in swift?
user3766930
  • 5,629
  • 10
  • 51
  • 104
3
votes
1 answer

How to intercept a phone number click (Call button) on link in UITextView?

Is there a callback to identify when the user clicks Call in the Popup that comes when we click on a number in a textview? func textView(textView: UITextView, shouldInteractWithURL URL: NSURL, inRange characterRange: NSRange) -> Bool The function…
3
votes
3 answers

How to programmatically enter text in UITextView at the current cursor position

I would like to add (some predefined) text at the current cursor position in a UITextView using Swift. So if I have a UITextField named txtField that has some text in it already such as "this is a beautiful valley" and I tap in the area between "a"…
3
votes
0 answers

UITextField auto-completion callback

I am using a library for field validation which relies on UITextFieldTextDidChangeNotification. It simply validates fields in a form when this notification gets fired and sets a form state (like invalid, eligible, submittable). However, when I…
3
votes
3 answers

Insert date/time in UITextView when user hits return

Im trying to Insert the current date/time whenever the users hits the return key or starts typing on a UITextView in Xcode but not quite sure where to start. I know this method is for when clicking into the TextView but doesn't seem to work: -…
GregD
  • 31
  • 3
1 2
3
14 15