first-responder

iPad keyboard will not dismiss if modal ViewController presentation style is UIModalPresentationFormSheet

大憨熊 提交于 2019-12-16 22:35:19
问题 Note: See accepted answer (not top voted one) for solution as of iOS 4.3. This question is about a behavior discovered in the iPad keyboard, where it refuses to be dismissed if shown in a modal dialog with a navigation controller. Basically, if I present the navigation controller with the following line as below: navigationController.modalPresentationStyle = UIModalPresentationFormSheet; The keyboard refuses to be dismissed. If I comment out this line, the keyboard goes away fine. ... I've

How to move to next TextField in SwiftUI?

99封情书 提交于 2019-12-13 03:38:29
问题 Using Swift5.1.2, iOS13.2, Xcode-11.2, Having several TextFields in a Stackview, I would like to move to the next TextField as soon as the user types x-amount of characters into the first TextField. With this link, I achieve to recognise when a TextField entry has reached x-amount of characters. However, I do not know how to make the firstResponder jump to a second TextField inside my StackView. Is there a solution to this inside SwiftUI ? 来源: https://stackoverflow.com/questions/58673159/how

Receiving RemoteControlEvents to First Tab when interacting in Second Tab in a TabBar Controlled iOS App

孤人 提交于 2019-12-12 14:47:02
问题 I am developing an iOS app with a tab bar controller. In the first tab, I placed an instance of AVQueuePlayer to start playing music from the web. I did all coding to allow play and pause events through remote control events. But I could able to receive remote control events only when I stay in the first tab. When I switch to other tabs, remote control events are not received to the first tab. When I place the following lines in first tab view controller, I can receive remote control events

UIView automatically moving by uitextfield keyboard

北战南征 提交于 2019-12-12 03:25:16
问题 So i have a really weird problem at my hands and hours of search has provided nothing. I have a uiview containing a uitextfield. Now initially this view is outside of the visible screen with coordinates like x=-500,y=-500. However in response to a button press this view animates and moves into the center of the screen. Now whenever i tap on a uitextfield that is the subview of this view.This view moves back to its original coordinates outside the screen. I have frantically checked my code and

touchesEnded:withEvent: from UIScrollView First Responder

淺唱寂寞╮ 提交于 2019-12-11 23:51:39
问题 I've made a UIScrollView the first responder. I need to maintain touch events to a -touchesEnded:withEvent: method on a view behind it. I've tried using the -nextResponder method and that failed. I've tried forwarding -touchesEnded:withEvent: to the view behind it and that fails. How do I get this to work? The UIScrollView wont work unless it is the first responder or gets events some other way. Thank you for any help. Shame Apple's documentation and APIs are terrible in areas. 回答1:

CNContactViewController does something strange with responder chain

拟墨画扇 提交于 2019-12-11 12:42:59
问题 I am trying to implement UIKeyCommand shortcuts in my app, and for the most part, it seems to work fine. Except when I present CNContactViewController in a modal view, where it seems to do something strange: after the CNContactViewController is dismissed, the keyboard shortcuts still show in the discoverability HUD but stop working throughout the app, even if the presenting view controller manually calls becomeFirstResponder after the CNContactViewController was dismissed. This is from

stop popoverViewController resignFirstResponder after dismissed

不想你离开。 提交于 2019-12-11 05:12:57
问题 I am using a uitableview containing multiple rows, and each row contains two UITextFields side by side. let's say TextField1, TextField2. When a user taped on TextField1, and start typing, a popoverViewController shows up for suggestions. When the user tap on a suggestion from the popoverViewController, the popover dismissed (this is what i want), then the keyboard dismissed as well (this is not what i want). if now the user tap on TextField2, the keyboard comes up. I want to keep the

UIScrollView inside UIScrollView – ignore scroll view touches when in bounds of text view?

情到浓时终转凉″ 提交于 2019-12-11 02:03:29
问题 I have one UIScrollView inside another UIScrollView , both scrolling vertically. I’m having an issue where when I try to scroll the inner scroll view, the touches are also picked up just afterwards by the outer scroll view. I need touches in the inner scroll view to be exclusively handled by it, and for scrollViewDidScroll to NOT be called on the parent scroll view. I’ve tried all manner of things, subclassing the scroll view and overriding hitTest:withEvent , setting canCancelContentTouches

resignFirstResponder to UITextViews on UITableViewCells that are no longer on screen

你说的曾经没有我的故事 提交于 2019-12-11 00:53:56
问题 I have a UITableView with a whole bunch of custom UITableViewCells in it. Each of these UITableViewCells has a UITextView in them. The problem I'm having, is that if the user touches a UITextView , that becomes the firstResponder and the keyboard pops up. If the user then scrolls down to a point where the UITableViewCell that the firstResponder is on is no longer on the screen, I can't get at the UITextView to dismiss it. I've tried holding (and retaining) a reference to the UITextView , but

FirstResponder missing redo:

半城伤御伤魂 提交于 2019-12-10 12:58:17
问题 Why my FirstResponder in InterfaceBuilder's file is missing redo: connection (in Received Actions list)? undo: exists, but redo: doesn't. How could I fix it? 回答1: This is a bug. The workaround is to throw this in a file somewhere: @interface NSResponder (Redo) - (IBAction)redo:(id)sender; @end Then make your connection in Interface Builder. Once that is done you can delete this code. 回答2: This is a bug in Xcode, it doesn't see the redo: action even though it is there. As a workaround you can