Questions tagged [uievent]

fA UIEvent object (or, simply, an event object) represents an event in iOS. There are three general types of event: touch events, motion events, and remote-control events. It is declared in UIKit framework. It is available in iOS 2.0 and later

A UIEvent object representing a touch event is persistent throughout a multi-touch sequence. UIKit reuses the same UIEvent instance for every event delivered to the application.

You can obtain event types and subtypes from the type and subtype properties. UIEvent defines event types for touch, motion, and remote-control events. It also defines a motion subtype for "shake” events and a series of subtype constants for remote-control events, such as “play” and “previous track.” The first responder or any responder in the responder chain implements the motion-related methods of UIResponder (such as motionBegan:withEvent:) to handle shaking-motion events. To handle remote-control events, a responder object must implement the remoteControlReceivedWithEvent: method of UIResponder.

The touchesForGestureRecognizer: method, which was introduced in iOS 3.2, allows you to query a gesture-recognizer object (an instance of a subclass of UIGestureRecognizer) for the touches it is currently handling.

Source: UIEvent Class Reference

Related SO questions:

UIGestureRecognizer receive touch but forward it to UIControl as well

App crash on sendEvent method

119 questions
1
vote
1 answer

Intercept UIControlEventTouchUpInside in hitTest:withEvent:

I have followed this great tutorial and I finally managed to implement a 3 independent rows scrollable interface. I am left with a problem though, as the key of that tutorial is the use of method: - (UIView *)hitTest:(CGPoint)point…
Fabrizio Prosperi
  • 1,268
  • 3
  • 16
  • 30
1
vote
1 answer

Receiving UI events in C++ classes

I'm writing Objective-C++ in Xcode for iOS. My project is mostly C++ classes and a few Objective-C classes at the highest level. My C++ classes contain Objective-C UI elements and I need them to receive UI events. Is it possible for a UI element to…
Luke
  • 6,780
  • 6
  • 39
  • 69
1
vote
0 answers

Re-issuing a touch event

I'm trying to create an overlay view that monitors for touches and then disappears, but also forwards touch events to whatever is underneath the view. My test app has a view with a button inside. I add the overlay view as another subview (sibling to…
Karl
  • 12,926
  • 8
  • 41
  • 59
1
vote
0 answers

Order of UIGestureRecognizer touchesBegan(_:with:) and point(inside:with:)

The Question When the user taps on a view which of these two functions is called first? touchesBegan(_:with:) or point(inside:with:). The Context I want to subclass a PKCanvasView (which inherits from UIScrollView) to allow interaction through the…
santi.gs
  • 278
  • 1
  • 8
1
vote
1 answer

UIResponder Chain Explanation Needed

I'm having trouble getting my UIButtons, UIScrollViews etc working in this situation: I have the base UIViewController, which is the root controller of the UIWindow. Above that layer I have some other UIViews added, which I will call the "Middle…
Rich Brooks
  • 501
  • 1
  • 6
  • 17
1
vote
0 answers

Why is my app not responding to remote control events?

I'm making an app that plays an audio stream on the background when the device is locked. I want the app to respond to the media controls on the lock screen. I followed this answer but for some reason I can't make my app respond to these controls.…
Marilyn García
  • 85
  • 1
  • 12
1
vote
0 answers

Lifting 2/2 Fingers off a UIView vs. lifting just 1/2

When the user has 2 fingers on a UIView and lifts both simultaneously this code will determine event.touches(for: self).count to be 2. override func touchesEnded(_ touches: Set, with event: UIEvent?) { print(event?.touches(for:…
Marmelador
  • 790
  • 5
  • 22
1
vote
1 answer

Getting a vector from a touch location in swift 3

As the title says, how can I accomplish this? I can get the first touch but I don't know how to get the last touch if it is a swiping gesture. With the following code I get the error: value of type 'Set' has no member 'last'. Not really sure how to…
Lyres
  • 193
  • 1
  • 13
1
vote
1 answer

what does it mean when it said "an event couldn't be handled"?

I am reading through the documentation of UIResponder class and I came across the responder chain. Now it's said that for example, when a hit-test can't handle an event, it passes it up a chain of responders. So, what example can clarify how an…
Badr
  • 461
  • 4
  • 18
1
vote
1 answer

GPUImage does not update when MotionShake detected

I have a fuction, which after a shake, resets all sliders to their defaults and calls -proccesImage after the slider's value has been changed. The problem is that each of the sliders do, in fact, get reset to the default positions but GPUImage does…
Casper
  • 265
  • 3
  • 11
1
vote
2 answers

How to make image view as button in Objective-C?

For example: Collection view have four images,The user touches any cell mean its want to go to another view controller.give some idea for me friends. Take this image as example if the user click the chrome image means it go to another view…
1
vote
1 answer

How are UI events generated in WPF?

I am trying to understand how UI related RoutedEvents are generated in WPF. For instance, how does pressing the left mouse button on a control starts the tunneling of PreviewMouseDown? I couldn't find a clear answer myself. My intuition is that the…
elnigno
  • 1,611
  • 14
  • 34
1
vote
1 answer

Multiple touch location in iOS?

I want to get two touch point on multitouch. I am touching and holding one point then after i touch second point on screen. Then touches moved method called but both time i get the frirst touch location.I am not geting second touch position in…
Rajesh Maurya
  • 2,796
  • 3
  • 16
  • 34
1
vote
1 answer

Touch event forwarding in iOS

I have a UI component that I want to display in my app, in such a way that any touch event at all dismisses it (though touching the component itself would yield a different result that touching outside of it). My current solution is to have a…
Mason
  • 6,345
  • 15
  • 67
  • 113
1
vote
2 answers

Generating Remote Control Events from my app

I have two questions regarding Remote Control Events on iOS: I know that music applications are registered to remote control events and then can receive such events from the iPhone's player widget. Let's say I want my app to fire such events, is…
Gal
  • 1,542
  • 2
  • 14
  • 30