Questions tagged [resignfirstresponder]

A UIResponder method added for handling remote-control events. for iOS 4 and iOS4+

When the user taps a control that can accept first responder status, that control is sent the becomeFirstResponder message. Until another control becomes the first responder or the current control is sent the resignFirstResponder message, that control will keep this status and receive keyboard and shake input.

170 questions
1
vote
0 answers

Override resignFirstResponder: return value from super?

I have a custom view with a text field in it, I need to override resignFirstResponder() in my custom view to dismiss the keyboard for the embedded text field. When I read the doc it says: The default implementation returns true, resigning first…
Heuristic
  • 5,087
  • 9
  • 54
  • 94
1
vote
0 answers

TextField does not return on outside tap

I'm a novice Swift and SwiftUI developer and I have a textfield embedded in a form. I'd like the textfield to return when the user taps anywhere outside of the textfield, and I'm struggling to make this happen. The following toy example illustrates…
ej5607
  • 309
  • 2
  • 12
1
vote
3 answers

UITextField - resignFirstResponder Query

I have an application which has a couple of UITextField present to allow my user to enter their age, and another numerical value. Ideally, I want the keyboard to bring up the numeric keypad when the TextField is being edited. At present I have it…
Paul Morris
  • 1,763
  • 10
  • 33
  • 47
1
vote
1 answer

UITextField: attributedText not working properly while resignFirstResponder

I have a UITextField and a button, the button highlights the last letter of the text field's text as well as dismissing the keyboard: private func highlightLast() { guard let text = textField.text, text.count > 1 else { return } …
Heuristic
  • 5,087
  • 9
  • 54
  • 94
1
vote
2 answers

After becomeFirstResponder textField doesn't send events to delegate

can anybody help me in such situation: I have SigninController class with two textFields (as Outlets) txtLogin and txtPassword: when I filled txtLogin, I call [txtPassword becomeFirstResponder] to pass input focus to next field (return button works…
1
vote
3 answers

IPhone app xcode, trying to hide text input by clicking on the background?

I'm following an example in Beginning Iphone Development 4 for basic user interaction. I'm using xcode 4.02 with sdk 4.3 I have a basic viewcontroller.xib with two textbox's, one for numeric values and another for text. Once I'm finished editing…
Mantisimo
  • 4,203
  • 5
  • 37
  • 55
1
vote
4 answers

UITextView: Must I always resignFirstResponder?

Must I always resignFirstResponder for a UITextView? Or, will this happen automatically when its view controller disappears? I'm asking because I'm having an issue similar to iPhone Objective-C: Keyboard won't hide with resignFirstResponder,…
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
1
vote
1 answer

How could I keep keyboard up when tableview cells are tapped?

I am a beginner learning Swift and trying to build a search page with Swift. In my search page of the app, I have added two Views in my storyboard with one View above the other. The upper View contains a Collection View where I have two prototypes…
1
vote
1 answer

resignFirstResponder() didn't work for Date Picker

I have a very simple CustomIDatePicker class written in Swift 5, which has a toolbar on top that contains a 'Done' button. The issue is, the keyboard never retracted when this button was pressed. I have tried 4 different methods, please see details…
Steve
  • 95
  • 12
1
vote
0 answers

Keyboard For UITextView Remains Visible After Dismissing It - Swift 5

I have a view with many input fields. All of them are UITextFields expect for the one at the very bottom, which is a UITextView. For some reason when I tap the screen to call view.endEditing() to dismiss the keyboard from the UITextView, sometimes…
yambo
  • 1,388
  • 1
  • 15
  • 34
1
vote
0 answers

When i try dismiss keyBoard with interactive mode, i have an error for my inputAccessoryView

I've implemented inputAccessoryView with UITextView. I also set collectionView.keyboardDismissMode = .interactive When i dissmiss keyboard by using interactive mode i have this two error 1) - First responder warning: '<.InputTextView:…
1
vote
5 answers

how to hide keyboard immediately after tapping on a text field?

I have a custom textfield. It opens a pop-up using UITableViewController, when user taps on it. I wanted to prevent keyboard to pop-up for my text field, looks like it is not possible. So I tried the following code which works in simulator, but it…
Iman Nia
  • 2,255
  • 2
  • 15
  • 35
1
vote
1 answer

Is it okay to call UIResponder.resignFirstResponder directly?

I just started to suspect that calling resignFirstResponder directly is not actually allowed. Unlike NSResponder, it's allowed to call becomeFirstResponder directly in UIKit. So far I was making assumption that calling resignFirstResponder would be…
eonil
  • 83,476
  • 81
  • 317
  • 516
1
vote
1 answer

In a webview, how do I know when an input should resignFirstResponder

Portions of my app present users with forms via a webview. I've had a few users ask why after entering data into a field when they continue to scroll down the form/webview the keyboard remained visible on the screen. I cannot seem to find any…
propstm
  • 3,461
  • 5
  • 28
  • 41
1
vote
3 answers

UIAlertController with textfield: how dismiss keyboard works?

In my UIViewController subclass I created a UIAlertController with a UITextField: class MyViewController: UIViewController { ... let alertController = UIAlertController(title: "a title", message: "", preferredStyle: .alert) let okAction =…
Giorgio
  • 1,973
  • 4
  • 36
  • 51