uikeyboard is an iOS object used to represent a keyboard. Implementors use it to create an interface which approximates a physical keyboard
Questions tagged [uikeyboard]
1038 questions
1787
votes
99 answers
How can I make a UITextField move up when the keyboard is present - on starting to edit?
With the iOS SDK:
I have a UIView with UITextFields that bring up a keyboard. I need it to be able to:
Allow scrolling of the contents of the UIScrollView to see the other text fields once the keyboard is brought up
Automatically "jump" (by…

philfreo
- 41,941
- 26
- 128
- 141
502
votes
43 answers
Close iOS Keyboard by touching anywhere using Swift
I have been looking all over for this but I can't seem to find it. I know how to dismiss the keyboard using Objective-C but I have no idea how to do that using Swift? Does anyone know?

lagoon
- 6,417
- 6
- 23
- 30
341
votes
42 answers
Move view with keyboard using Swift
I have an app that has a text field on the lower half of the view.
This means that when I go to type in the text field the keyboard covers the textfield.
How would I go about moving the view upwards while typing so I can see what i'm typing and then…

Alex Catchpole
- 7,156
- 6
- 20
- 29
191
votes
22 answers
How do you dismiss the keyboard when editing a UITextField
I know that I need to tell my UITextField to resign first responder when I want to dismis the keyboard, but I'm not sure how to know when the user has pressed the "Done" key on the keyboard. Is there a notification I can watch for?

kubi
- 48,104
- 19
- 94
- 118
182
votes
12 answers
Programmatically change UITextField Keyboard type
Is it possible to programmatically change the keyboard type of a uitextfield so that something like this would be possible:
if(user is prompted for numeric input only)
[textField setKeyboardType: @"Number Pad"];
if(user is prompted for…

eric.mitchell
- 8,817
- 12
- 54
- 92
138
votes
13 answers
How to get height of Keyboard?
The height of a keyboard on varying iOS devices is different. Does anybody know how I can get height of a device's keyboard programmatically?

Lachtan
- 4,803
- 6
- 28
- 34
107
votes
14 answers
How to make return key on iPhone make keyboard disappear?
I have two UITextFields (e.g. username and password) but I cannot get rid of the keyboard when pressing the return key on the keyboard. How can I do this?

K.Honda
- 3,106
- 5
- 26
- 37
106
votes
29 answers
Dismiss keyboard by touching background of UITableView
I have a UITableView with UITextFields as cells. I would like to dismiss the keyboard when the background of the UITableView is touched. I'm trying to do this by creating a UIButton the size of the UITableView and placing it behind the…

Hua-Ying
- 3,166
- 4
- 23
- 25
94
votes
18 answers
UI Test deleting text in text field
In my test I have a text field with a pre-existing text. I want to delete the content and type a new string.
let textField = app.textFields
textField.tap()
// delete "Old value"
textField.typeText("New value")
When deleting string with hardware…

Tomasz Bąk
- 6,124
- 3
- 34
- 48
86
votes
15 answers
Allow only Numbers for UITextField input
The iPad does not have a "Numpad" keyboard like the iPhone/iPod does.
I'm looking to find how I can restrict the user's keyboard to only accept values 0 through 9.
I would imagine using UITextField's "shouldChangeCharactersInRange" but I don't know…

Demasterpl
- 2,103
- 5
- 24
- 32
85
votes
12 answers
Getting keyboard size from userInfo in Swift
I have been trying to add some code to move my view up when the keyboard appears, however, I am having issues trying to translate the Objective-C examples into Swift. I have made some progress, but I am stuck on one particular line.
These are the…

user3746428
- 11,047
- 20
- 81
- 137
69
votes
2 answers
HW kbd Failed to set (null) as keyboard focus ios
In my iOS app crash log I found this statement:
HW kbd Failed to set (null) as keyboard focus ios
Does anyone know what is this and how to resolve it?

Waris Shams
- 1,606
- 1
- 15
- 27
67
votes
6 answers
dismiss keyboard with a uiTextView
I am sure this is not that difficult, but I am having trouble finding info on how to dismiss a keyboard with the return/done key using a textview, not a textfield. here is what I have tried so far(which works with a textfield.)
Thanks very much in…

user3708224
- 1,229
- 4
- 19
- 37
63
votes
19 answers
How to dismiss keyboard when touching anywhere outside UITextField (in swift)?
I'm working on a project that have a UIViewController, on the view controller there is a UIScrollView and a UITextField on the scrollview.
like this:
I'm trying to dismiss the keyboard and hide it after typing some text in the textfield and tap…

White Hat
- 681
- 1
- 6
- 15
62
votes
3 answers
Change text of "Return" keyboard button
How can I change the standard text of the "Return" button to something else?
I want it to be "Add".

Ilya Suzdalnitski
- 52,598
- 51
- 134
- 168