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
2
votes
0 answers

Cursor in TextView Too Small Initially?

I have an iOS Application. When the user clicks on a textview, the cursor is very small initially. This is what it looks like: As soon as the user begins typing, the cursor changes size and becomes much bigger. This is what it looks like: As you…
Everett
  • 387
  • 1
  • 4
  • 17
2
votes
1 answer

UITextView - Begin Editing With All Text Selected In UITableViewCell()

I have a tableView with an object TaskCell which is a subclass of UITableViewCell The textView is in the TaskCell and everything works fine except I can not get this line of code to select all text in the text view so the user can immediately…
lifewithelliott
  • 1,012
  • 2
  • 16
  • 35
2
votes
1 answer

textViewDidChangeSelection method thinks textView.text is empty

For various reasons, I need to access the text in a textview whenever a selection is changed, so I have implemented the delegate method textViewDidChangeSelection() to do so. For some reason though, when I try to access textView.text from within…
2
votes
2 answers

iOS - Cannot access UITextView delegate inside a UITableViewCell class

I've found some problems when trying to access the UITableViewDelegate methods, inside an instantiated UITableViewCell class. I'm trying to access the func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange) ->…
Ivan Cantarino
  • 3,058
  • 4
  • 34
  • 73
2
votes
3 answers

UITextView characters remaining

How can I set characters remaining on a UILabel for the UITextView? I have done this for the UITextField, but the same code does not work.. This is what I have tried: func textView(textView: UITextView, shouldChangeCharactersInRange range: NSRange,…
Roduck Nickes
  • 1,021
  • 2
  • 15
  • 41
2
votes
0 answers

[NSConcreteTextStorage attributesAtIndex:effectiveRange:]: Range or index out of bounds

I use uitextview for input text multi-line, and limit line of text input. In iOS7, app will be crash when input full text and typing multi stage character(Japanese Language). (I cannot repeat this problem but my customer said ,and it shows the error…
2
votes
0 answers

UITextView subclass - How do you override delegate function shouldChangeTextInRange?

I've subclassed UITextView and want to override the shouldChangeTextInRange delegate function to handle maximum number of lines. So I have the following setup: @interface CustomFieldView : UITextView Then in the .m I set my…
2
votes
1 answer

How to use UIKeyboardWillShowNotification

I want to create a ChatView exactly like iPhone's texting app (Messages). I'm doing it programmatically and am trying to move the textView up with the keyboard. I want to do this in a function that gets called by UIKeyboardWillShowNotification.…
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
2
votes
0 answers

UITextView top of the text is shown half when pressed on new line, rest is clipped

Check out the gif below, as you see the textview is normal. When I press the return button the top text gets clipped, when I enter a letter or press return again its fixed. After that the next return also clips the text. There is also unnecessary…
Esqarrouth
  • 38,543
  • 21
  • 161
  • 168
2
votes
0 answers

"textView:shouldChangeTextInRange:replacementText:" not called with Chinese keyboard

I have a UITextViewwhich I use for typing message and modifying the text for tagging people. I use the -textView:shouldChangeTextInRange:replacementText: delegate method to detect changes and modify the text, which works perfectly fine in English.…
Armin
  • 1,150
  • 8
  • 24
2
votes
1 answer

Cannot assign a value of type 'MyViewController' to a value of type 'UITextFieldDelegate?'

Not sure why I am getting this error (title of this issue is the error as shown in screenshot below) when I try to do self.tv_salaryNumber.delegate = self. My class EarningsVC does in fact inherit the UITextFieldDelegate protocol, so cant figure out…
user1406716
  • 9,565
  • 22
  • 96
  • 151
2
votes
2 answers

How do you run a section of code when the user taps the UITextView in Swift?

So I have a UITextView and some placeholder text inside. When the user taps inside the the view, I want to execute some code, i.e. clear the placeholder text. I was trying to create an IBAction but it won't let me. I looked it up online and found…
Jake
  • 319
  • 1
  • 7
  • 21
2
votes
1 answer

iOS toggle default keyboard from ABC mode to 123 mode via code?

I can see how to set the keyboard's overall type via: self.myTextView.keyboardType = UIKeyboardTypeDefault; How can I toggle the default keyboard's mode from ABC to 123 and back again via code? Basically the moment the user taps the @ character…
John Erck
  • 9,478
  • 8
  • 61
  • 71
2
votes
3 answers

UITextField is not a maximum of 1 number when I combine it with resignFirstResponder

The code that checks if the maximum numbers is 1, works when I only use that piece of code. But when I add the automatic jumping to the next UITextField with [becomFirstResponder], it doesn't work anymore. Many thanks guys! When…
Jim Clermonts
  • 1,694
  • 8
  • 39
  • 94
2
votes
1 answer

UITextView Scrolling / ContainHeight unusual behaviour

I need to change UITextView Frame height dynamically with respect to content height of it. i.e. so when ever contain height is increased rather than allowing user to scroll i would like to change my UITextView's Frame height so users can read all…
user2618646
  • 163
  • 1
  • 8