Questions tagged [uitextinput]

UITextInput is an iOS protocol that defines behaviors for interacting with and responding to text selection, autocorrection, and other text input events.

UITextInput is an iOS () protocol that defines behaviors for interacting with and responding to text selection, autocorrection, and other user text input events. It allows conforming classes to respond to dictation (on iOS 5.1+), modify selected text, position the selection UI elements, etc. UITextField () and UITextView () are the two most commonly used classes that conform to the protocol.

For more information, please see the Apple Documentation for UITextInput.

89 questions
20
votes
3 answers

UITextField begin dictation

I'd like to programmatically put my UITextField input into dictation mode, without requiring the user to bring up and select dictation from the keyboard. Searched the API documentation but can find no solution. Any ideas?
pjg
  • 565
  • 4
  • 19
10
votes
2 answers

UITextField ignoring inputDelegate?

Does UITextField ignore the inputDelegate? Using the following code: - (void)viewDidLoad { [super viewDidLoad]; self.textField.inputDelegate = self; NSLog(@"textField: %@", self.textField); NSLog(@"delegate: %@",…
David Beck
  • 10,099
  • 5
  • 51
  • 88
10
votes
3 answers

Adding a cancel button to UITextField keyboard

Is there a way to add a cancel button to the keyboard displayed for UITextField? Looking over the UITextInputTraits Protocol Reference, I could not find anything, including trying out the different keyboard types.
Andrew Lauer Barinov
  • 5,694
  • 10
  • 59
  • 83
9
votes
3 answers

How to update UITableViewCell height because of text entered into UITextView

I have different examples where we can update the UITableViewCell height based on growing UITextView which actually is working for me. The issue which I am facing is, I have more subviews below UITextView inside a UITableViewCell. This way, the…
Nitish
  • 13,845
  • 28
  • 135
  • 263
8
votes
1 answer

UITextInput: selectedTextRange vs. markedTextRange?

Ok, so I know Apple's UITextInput protocol requires the two UITextRange properties selectedTextRange and markedTextRange and the documentation says that selectedTextRange is a subrange of markedTextRange which is an uncomfirmed text range by the…
rolling_codes
  • 15,174
  • 22
  • 76
  • 112
8
votes
4 answers

UITextView get the current line

Is there a way (crazy hacks welcome) to get the current line as a string of a UITextView? This would include word wrapping, etc. For example, in this case: The method would return "stack overflow. Isn't it great? I" because that is the current…
roozbubu
  • 1,106
  • 4
  • 14
  • 30
7
votes
2 answers

UITextInput setMarkedText:selectedRange not working? (Can't be!)

I want to set the marked text programmatically and since iOS5 UITextView and UITextField conform to UITextInput this should be possible but for some reason I always get the markedText to be nil. :( What am I missing here? This is what I've tried…
nacho4d
  • 43,720
  • 45
  • 157
  • 240
7
votes
1 answer

UISearchBar and dictation support

I have user interface with UISearchBar and I implement the UISearchBarDelegate's searchBarSearchButtonClicked: to perform the search. I do not have a device with dictation support to test this, so I'm going to speculate here... On devices with…
Palimondo
  • 7,281
  • 4
  • 39
  • 58
6
votes
1 answer

Property UITextField.beginningOfDocument is always nil on iOS 8, 9. Serious bug in iOS?

It seems that with iOS 8 and 9, Xcode 7 the properties beginningOfDocument and endOfDocument of UItextField are always nil whathever you do. Even worse they are not of an optional type (UITextPosition?) in Swift 2, instead they are of type…
Rasto
  • 17,204
  • 47
  • 154
  • 245
6
votes
2 answers

Custom Input View in Swift

I've spent hours trying to figure out how to create/then get a custom inputView to work. I have a grid of TextInputs (think scrabble board) that when pressed should load a custom inputView to insert text. I've created a .xib file containing the UI…
6
votes
3 answers

UITextView not saving markedTextStyle (UITextInput protocol)

Marking text in a UITextView, but for some reason it's refusing to accept anything I give it with setMarkedTextStyle. -markedTextStyle always returns nil, and the marked text always looks the same (blue background and maintains text…
Christian A. Strømmen
  • 3,181
  • 2
  • 25
  • 46
6
votes
1 answer

Handle marked text on iOS keyboard

According to the doc, Marked text, which is part of multistage text input, represents provisionally inserted text that the user has yet to confirm. It is styled in a distinctive way. The range of marked text always contains within it a range…
Jason Lee
  • 3,200
  • 1
  • 34
  • 71
6
votes
3 answers

Using Dictation - iOS 6 - DidStart?

How to respond to starting dictation? Known ways of responding to dictation: dictationRecordingDidEnd - respond to the completion of the recognition of a dictated phrase. dictationRecognitionFailed - respond to failed dictation…
Zelko
  • 3,793
  • 3
  • 34
  • 40
6
votes
2 answers

(# ゚Д゚) is a 5-letter-word. But in iOS, [@"(# ゚Д゚)" length] is 7. Why?

(# ゚Д゚) is a 5-letter-word. But in iOS, [@"(# ゚Д゚)" length] is 7. Why? I'm using to modify the text in a UITextField or UITextView. When I make a UITextRange of 5 character length, it can just cover the (# ゚Д゚) . So, why this (# ゚Д゚)…
YuAo
  • 1,427
  • 1
  • 10
  • 17
6
votes
2 answers

Animating UITextInput's textInputView

UIKit text input components, such as UITextView and UITextField have a property inputView to add a custom keyboard. There are two questions I have relating to this. If the keyboard is currently visible and the property is set to a new input view,…
Anthony Mattox
  • 7,048
  • 6
  • 43
  • 59
1
2 3 4 5 6