Questions tagged [becomefirstresponder]
176 questions
30
votes
4 answers
get notified when UITextField becomeFirstResponder
How I can get notified when UITextField becomeFirstResponder ?
I can check like isFirstResponder or set to to become first Responder by becomeFirstResponder
I want to get notified or handle an event when a user make this text field first…

shebelaw
- 3,992
- 6
- 35
- 48
21
votes
2 answers
_UIButtonBarStackView: breaking constraint when becomeFirstResponder sent
When jumping from one textfield to an other, get this:
translatesAutoresizingMaskIntoConstraints)
(
"",
"

János
- 32,867
- 38
- 193
- 353
21
votes
6 answers
Swift: Become First Responder on UITextField Not Working?
I've created a custom UIViewController with one UITextField on Storyboard. On viewDidLoad, I set the UITextFIeld to becomeFirstResponder, nothing happened (no keyboards popped up).
I then tried calling resignFirstResponder(), but it returned false.…

blee908
- 12,165
- 10
- 34
- 41
19
votes
4 answers
SwiftUI: How to fix 'AttributeGraph cycle detected through attribute' when calling becomeFirstResponder on UIViewRepresentable UITextField
I'm attempting to set a textfield as first responder using its tag property and a @Binding. As I am unable to access the underlying UITextField from a SwiftUI TextField and call .becomeFirstResponder() directly, I'm having to wrap a UITextField…

Elliott
- 301
- 1
- 2
- 5
17
votes
4 answers
Trouble shooting becomeFirstResponder not showing keyboard for some users
I got a TextView that is supposed to show upon a button press, and let the user enter text through the keyboard.
- (IBAction) changeName {
changeNameBtn.hidden = YES;
backBtn.hidden = YES;
usernameLabel.hidden = NO;
…

JOG
- 5,590
- 7
- 34
- 54
17
votes
2 answers
iOS Keyboard (inside UIRemoteKeyboardWindow) is Not Shown When UITextField Becomes First Responder in Touch ID Completion Block (iOS 10)
I've recently discovered a problem in my app that only seems to occur in iOS 10 where the system keyboard does not display when programmatically triggering a text field to become first responder inside of a completion handler -- specifically the…

Danchez
- 1,266
- 2
- 13
- 28
17
votes
4 answers
UITextField subview of UITableViewCell to become first responder?
I have a core data application which uses a navigation controller to drill down to a detail view and then if you edit one of the rows of data in the detail view you get taken to an Edit View for the that single line, like in Apples CoreDataBooks…

Daniel Granger
- 1,334
- 1
- 16
- 36
17
votes
4 answers
In iOS 6, -[UITextField becomeFirstResponder] doesn't work in -viewWillAppear:
In iOS 5.1 and iOS 5.0 it works, but in iOS 6.0 the keyboard does not show.
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
UITextField *textField = self.emailAddressTextField;
[textField…

Jeffery Thomas
- 42,202
- 8
- 92
- 117
15
votes
3 answers
UIKeyCommands don't work when intermediary viewController contains two viewControllers
I believe this is a non-trivial problem related to UIKeyCommands, hierarchy of ViewControllers and/or responders.
In my iOS 9.2 app I have a class named NiceViewController that defines UIKeyCommand that results in printing something to the…

mgamer
- 13,580
- 25
- 87
- 145
13
votes
4 answers
Keeping object on top of keyboard in the event of becomeFirstResponder or resignFirstResponder?
I currently have a UITextField on top of a keyboard. When you tap it, it should stick on top of the keyboard and move up smoothly. I don't know the exact duration and animation type of the keyboard, so it's really bumpy. Here's what I…

iosfreak
- 5,228
- 11
- 59
- 102
11
votes
4 answers
Focus on the UISearchBar but the keyboard not appear
I've read so many solution on how can i focus a searchbar to make keyboard appear when i open my search view, and all of that are like this
[searchBar becomeFirstResponder];
mine is
[self.searchDisplayController.searchBar becomeFirstResponder];
but…

Lorenzo
- 133
- 1
- 2
- 6
10
votes
1 answer
TextField becomeFirstResponder Issue for tab key(Keyboard) action
I have a view in XIB where i used several text fields in it. Let say the first text field becomes first responder as soon as the view gets loaded in the window. If i press tab key in my machine's keyboard to navigate to next text field ;apart from…

Balaji
- 261
- 6
- 12
10
votes
2 answers
How to show the keyboard for a UIView
I have a UIView where I want to receive keyboard input. I have tried:
[self becomeFirstResponder];
But it doesn't work.
I could implement a 'dirty' workaround by having a hidden UITextField and forwarding the keystokes to my UIView - but how does…

Ole Bjørn Setnes
- 748
- 5
- 20
8
votes
0 answers
becomeFirstResponder cause crash UICompatibilityInputViewController
I have a messaging app.
I have a UITabeView in ViewController. I implement my longPressGesture event on my Custom UITableViewCell like this to show UIMenuController on it ( copy - forward and ... )…

Mo Farhand
- 1,144
- 8
- 21
8
votes
1 answer
How to handle UITextField inside a keyboard app extension
I have added textfield (keyboardTextField) and UISwitch on top of my custom keyboard. I can set focus ON or OFF for (keyboardTextField) on the base of Switch value my code.
- (void)switchToggled:(id)sender
{
UISwitch *mySwitch =…

jamil
- 2,419
- 3
- 37
- 64