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
-1
votes
2 answers

Question about singletons in Cocoa Touch

I'm quite new to OOP and design patterns, but I've implemented the Singleton pattern once before to pass static arrays and string objects between different ViewControllers. I was wondering if there was an easy way to have all my ViewControllers…
ArtSabintsev
  • 5,170
  • 10
  • 41
  • 71
-1
votes
2 answers

SwiftUI (dismiss-keyboard) overlay disables underlying actions

This question is related to How to hide keyboard when using SwiftUI? Sample Code: struct ContentView: View { @State var text = "" var body: some View { Background { NavigationView { List { …
thisIsTheFoxe
  • 1,584
  • 1
  • 9
  • 30
-1
votes
1 answer

How can I make a UITextField the first responder, correctly? (Tried 3 methods)

Here's the setup: SNController is an NSObject and it has inside: UIView UITextField UISegmentedControl UILabel UIButton The view is the same as the view inside the ViewController. One can be visible at the time. When the UITextField is visible…
Vulkan
  • 1,004
  • 16
  • 44
-2
votes
1 answer

How to pass a responder to ScrollView?

My view hierarchy This is the View layer I created. I want to transfer all Touch Events that happen in UIView to UIScrollView, but I don't know how. I didn't put it as a SubView of ScrollView because UIView should be lock. I want to use the default…
jkey
  • 3
  • 2
1 2 3
17
18