Questions tagged [uiresponder]

The UIResponder class defines an interface for objects that respond to and handle events. It is the superclass of UIApplication, UIView and its subclasses (which include UIWindow). Instances of these classes are sometimes referred to as responder objects or, simply, responders.

The UIResponder class defines an interface for objects that respond to and handle events. It is the superclass of UIApplication, UIView and its subclasses (which include UIWindow). Instances of these classes are sometimes referred to as responder objects or, simply, responders.

There are two general kinds of events: touch events and motion events. The primary event-handling methods for touches are touchesBegan:withEvent:, touchesMoved:withEvent:, touchesEnded:withEvent:, and touchesCancelled:withEvent:. The parameters of these methods associate touches with their events—especially touches that are new or have changed—and thus allow responder objects to track and handle the touches as the delivered events progress through the phases of a multi-touch sequence. Any time a finger touches the screen, is dragged on the screen, or lifts from the screen, a UIEvent object is generated. The event object contains UITouch objects for all fingers on the screen or just lifted from it.

iOS 3.0 introduced system capabilities for generating motion events, specifically the motion of shaking the device. The event-handling methods for these kinds of events are motionBegan:withEvent:, motionEnded:withEvent:, and motionCancelled:withEvent:. Additionally for iOS 3.0, the canPerformAction:withSender: method allows responders to validate commands in the user interface while the undoManager property returns the nearest NSUndoManager object in the responder chain.

In iOS 4.0, UIResponder added the remoteControlReceivedWithEvent: method for handling remote-control events.

259 questions
0
votes
1 answer

Swift: Dismiss ViewController without keyboard slider

I present/dismiss ViewController with TextField like a fade. And keyboard do not need to slide on/out of the screen. For presenting i did that by: override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) …
Kolkos
  • 43
  • 4
0
votes
1 answer

UIButton selector not working after button tapped within WKWebView

I have a custom titleView with 2 custom UIButtons with arrow images that allow navigation to the next view controller in the paging structure. They work perfectly fine until a button is tapped within the WKWebView. Then they don't work anymore and…
0
votes
1 answer

How to fix this issue with the UIResponder as not recognized?

I'm making a NotePad application in Swift and I get the following issue: type 'Notification.Name' (aka 'NSNotification.Name') has no member 'UIResponder' Those are the lines of code I typed on: @objc func updateTextView (notification :…
Momo
  • 43
  • 1
  • 6
0
votes
2 answers

Sending messages from subview to superview in Cocoa, UIResponder?

I have all these subview which are touch sensitive, I want to send a message from the subview to the superview, to say that a user selected it, so the superview can communicate with the rest of the controller. I can not communicate between the…
Robert
  • 1
0
votes
1 answer

Disable all UIResponderStandardEditActions when UITextfield is empty

I am currently trying to prevent all UIResponderStandardEditActions like copy, paste, delete from showing up when the UITextfield is empty. I would only like to show them if the user has types a message. I have tried 2 solutions and currently don't…
mandem112
  • 181
  • 14
0
votes
1 answer

Touches landing in MKMapView are not sent to the UIApplication instance

I am intercepting all events (for debugging purposes) in my custom UIApplication subclass: [super sendEvent:event]; if(event.type == UIEventTypeTouches){ if(event.allTouches.anyObject.phase == UITouchPhaseBegan){ // NSLog(@"Touch began on…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
0
votes
0 answers

How AppDelegate reference to subclass of ViewController works

I am using Swift 4 and I am wondering how having a reference to a ViewController in AppDelegate works. I have two questions which I have put in bold. I understand that AppDelegate is a delegate that has functions that get called when the app becomes…
0
votes
1 answer

how canBecomeFirstResponder bring custom inputAccessoryView

I'm trying to make custom inputAccessoryView contain UITextField and docking it bottom like chat application but if i didn't use canBecomeFirstResponder = true inputAccessoryView are hidden(?) this is my code class MainVC: UITableViewController { …
PrepareFor
  • 2,448
  • 6
  • 22
  • 36
0
votes
2 answers

Missing First Responder in iOS 11 with Swift 4 App (Xcode 9.X)?

I have a stripped down, code based test app (no Storyboard), that has: UIWindow object ViewController, with its main View Single UIView object on top. - To test which object is the first responder, i evaluate in tochesBegan, inside the topView as…
eharo2
  • 2,553
  • 1
  • 29
  • 39
0
votes
0 answers

UITextField becomeFirstResponder() always returns 'false' when its superview is a uitableviewcell that is above the visible content

I have a text entry form implemented as a UITableViewController where each field in the form is a subview of a cell in the tableview. On my keyboard I have "next" and "prev" buttons that do the expected and call becomeFirstResponder() on the text…
iKe
  • 241
  • 2
  • 4
0
votes
1 answer

touchesEnded:withEvent: from UIScrollView First Responder

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…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
0
votes
3 answers

I am using a previous app but getting error in UIResponder.h

I am using a app of previous developer ,but when i compile it ,ig shows 5 errors at UIResponder.h and UIEvent.h error…
Ali
  • 10,774
  • 10
  • 56
  • 83
0
votes
1 answer

Open standard iOS keyboard, instead of custom one

I am calling becomeFirstResponder, and showing the keyboard with it. [inputTextField becomeFirstResponder]; However, it shows the custom keyboard that is installed on test device. Is there a way to show iOS Standard Keyboard for Number Pad?
mamba4ever
  • 2,662
  • 4
  • 28
  • 46
0
votes
1 answer

iPhone - temporarily disable keyboard

G'day All My app has a first run component that presents a login/signup screen & on successful login/signup moves on to loading the app's data. For those who've seen it the process follows similar style to that in Instagram. If the keyboard is…
Pedro
  • 878
  • 1
  • 12
  • 29
0
votes
1 answer

How to detect and implement touch events for single tap on home button?

Not sure if it is possible but is there any way to detect a single touch on the home button. To start with, I would simply like to add an NSLog if the user touches down once on the home button (without actually pressing), but I don't know where I…
hinterbu
  • 747
  • 2
  • 7
  • 12