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
87
votes
18 answers

Limit number of characters in uitextview

I am giving a text view to tweet some string . I am applying the following method to restrict the number of characters to 140 in length. - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString…
harshalb
  • 6,012
  • 13
  • 56
  • 92
19
votes
1 answer

UITextView doesn't show InputAccessoryView on first click

I use the UITextViewDelegate and add a InputAccessoryView in textViewDidBeginEditing: [textView setInputAccessoryView:doneBar]; The doneBar is not nil and it appears on second opening. Has anyone else this problem? Thanks in advance.
Fabio Poloni
  • 8,219
  • 5
  • 44
  • 74
16
votes
4 answers

how to insert text at any cursor position in uitextview?

i want to implement Code by which i can start to insert text at any position of cursor in UITextView in iphone sdk any idea? thank you in advance.. i refereed this link: iPhone SDK: How to create a UITextView that inserts text where you tap? But…
kushalrshah
  • 638
  • 1
  • 5
  • 14
15
votes
2 answers

iOS 13.1 UITextView delegate method shouldInteract called when scrolling on attachment

I'm using the UITextView delegate method to do some custom work like opening a in-app browser when user tapping on URL or attachment: func textView(_ textView: UITextView, shouldInteractWith URL: URL, in…
kukushi
  • 647
  • 9
  • 22
15
votes
5 answers

iOS4: Can't Programmatically Scroll to Bottom of UITextView

Before I was using this method.... //TextView is a UITextView [TextView scrollRangeToVisible:NSMakeRange([TextView length], 0)]; ...which would programmatically scroll to the end of the UITextView but it doesn't seem to be working in iOS 4.0. Is…
OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39
14
votes
7 answers

Is there a delegate call for when the text is changed on a UITextView?

When I set my UITextView programmatically like this: [self.textView setText:@""]; The delegate method textViewDidChange: does not get called. Is there a way I can find that without making a UITextView subclass?
SirRupertIII
  • 12,324
  • 20
  • 72
  • 121
14
votes
3 answers

Detect UITextView scroll location

I am trying to implement a form of a Terms & Conditions page where the "Proceed" button is only enabled once the user has scrolled to the bottom of a UITextView. So far I have set my class as a UIScrollView delegate & have implemented the method…
JamesLCQ
  • 341
  • 6
  • 12
13
votes
7 answers

Change the UITextView Text Direction

my language is not supported by iOS by default, so unicode is not an option so i am using a embedded true type font on a UITextView it works for the most part, but my issue is like Arabic, and Hebrew my language is written from right to left. So i…
Jinah Adam
  • 1,125
  • 2
  • 14
  • 27
12
votes
2 answers

UITextViewDelegate methods not being called (UITextView within UITableViewCell)

I must be doing something fundamentally wrong, my implementation methods for the UITextViewDelegate aren't firing. I have a UITextView that is a subview of a UITableCellView and the delegates aren't being called. -…
ToddB
  • 2,490
  • 3
  • 23
  • 40
10
votes
1 answer

Customise the quicktype suggestions in iOS Keyboard

I want to have quicktype suggestions to have my own certain application level needed phrases as suggestions when keyboard is open in uitextview. For example if user types "All" - In quicktype suggesstion I want to show "All is well" or "All is as…
AKG
  • 398
  • 1
  • 5
  • 23
9
votes
1 answer

iOS - UITextView + NSUndoManager

I'm trying to integrate the undo/redo features in a UITextView (I'm building a LateX editor) with no luck and to be honest I'm really confused about this argument. I don't understand the steps involved in those two operations, I mean I need two…
oiledCode
  • 8,589
  • 6
  • 43
  • 59
9
votes
1 answer

Delete (not Backspace) doesn't fire UITextViewDelegate's shouldChangeTextInRange

When using an external keyboard, my UITextView fires a shouldChangeTextInRange message just fine when I press the Backspace key ("backward delete"), but if I press Delete ("forward delete") then the method is never called at all, despite the view's…
phu
  • 1,199
  • 2
  • 10
  • 20
8
votes
3 answers

Confirm UITextview auto-complete

This seems impossible, but maybe someone else has had the same problem. Is it possible for me to accept an autocomplete programmatically, or in some way get the suggested word that pops up? My problem is that I'm capturing the return/backspace…
f0rz
  • 1,495
  • 2
  • 14
  • 26
8
votes
3 answers

Dynamic UITextView mislocation behavior

I am trying to have a textview similar to iPhone messages, where the textview initially has a constraint (height <= 100) and the scrollEnabled = false This is a link to the project: https://github.com/akawther/TextView The text view increases in…
user3126427
  • 855
  • 2
  • 14
  • 29
8
votes
2 answers

How to stop cursor changing position when I setAttributedText in UITextView delegate method textViewDidChange

The following code changes "test" in the textView's string to red color but it also has the effect of moving the cursor to the end of the text block when textViewDidChange is called (Aka when any text editing is made which is very annoying). How…
KarlHarnois
  • 115
  • 7
1
2 3
14 15