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

120 questions
0
votes
1 answer

Programmatically initiate hitTest:WithEvent after gesture recognizer was canceled and return a different UIView to respond to events

I am overriding hitTest:withEvent to return self (the bottom most view)- When returning self - my view will respond to touch events in turn initiating gesture recognizers. If a gesture is canceled or some set of conditions happened - I want to…
Avba
  • 14,822
  • 20
  • 92
  • 192
0
votes
1 answer

Shake doesn't work when alert is shown

I implemented shake gesture event. When shake occurs i do some stuff. However if alert is shown I don't get event. Here is what I have: - (void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:YES]; // Register for shake detection …
Streetboy
  • 4,351
  • 12
  • 56
  • 101
0
votes
2 answers

Required single tap and double tap event on UIButton?

There are three UIButton Events available: UITouchUPInside UITouchDown UITouchDownRepeat My problem is: I have a button (Play-Pause). First time its shows play button, if user taps on it, it starts my process. And button image changes to Pause and…
Mrunal
  • 13,982
  • 6
  • 52
  • 96
0
votes
1 answer

implicit conversion of 'NSInteger' (aka 'int') to 'UIEvent *' is disallowed with ARC

Here is my relevant code: UITouch *touch; NSArray *touches = [NSArray arrayWithObject:touch]; //The statement below throw the LLVM compiler error [self touchesMoved:[NSSet setWithArray:touches] withEvent:UIEventTypeTouches]; here is the…
Malloc
  • 15,434
  • 34
  • 105
  • 192
0
votes
3 answers

How to have information that a touch event has happened and what kind of touch event and not handle it?

i want to create an NSNotification for all the the touch events happening with there specific recognise types and not handling them just observing them, any ideas?
0
votes
1 answer

How to call instance variable programmatically

The objective is to create a reminder event via Apple's documentation. So far I have the instance variable created (and implemented in the header file as well). - (EKReminder *)reminderWithEventStore:(EKEventStore *)eventStore { EKEvent *event …
JDev
  • 5,168
  • 6
  • 40
  • 61
0
votes
1 answer

Link two events to the same UIButton

I have created a UIButton programmatically in my iphone application using this code : UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(aMethod:) …
Free light
  • 93
  • 1
  • 7
0
votes
2 answers

How to enable my screen to respond to a UITouch only after the user is prompted with a message in my iOS app?

I need to enable my screen to respond to a user's touch, but only after they are prompted by a message that appears via an MBProgressHUD. I realize that I need to implement the -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent…
syedfa
  • 2,801
  • 1
  • 41
  • 74
0
votes
1 answer

Save events and time of its occuring in a plist iPhone

I have a UIViewcontroller with different UI elements in it. I would like to get a way to track the events occuring on that view ,its point of occurence,and the time of the event occuring without doing any hardcoding to save it on the corresponding…
Siddharth
  • 555
  • 4
  • 19
0
votes
0 answers

Button press events not getting called

I added a button on a subview of my main view, and when i am pressing that button... I can see it pressed but its selector is not getting called. And when i keep pressing the button for long then its selector method gets called. If i dont add that…
Vishal Singh
  • 4,400
  • 4
  • 27
  • 43
0
votes
1 answer

iOS app - push notification alert when entity date property reaches deadline

I'm trying to make an app that warns me when a current event is going to end. I have an entity (the event), with a date attribute - which is the end date for the event. How can I set a notification alert to pop up for like two days before the event…
0
votes
1 answer

Is it possible to decide which view the UITouch gets bound to?

I have several UIViews that have somewhat complex shapes that I have drawn via each UIView's drawRect: method. I have saved a reference to the path (via a CGPath property) and I am using that in my touches methods to detect whether or not the touch…
daveMac
  • 3,041
  • 3
  • 34
  • 59
-1
votes
1 answer

Capturing touches in UIApplication and calling a function in ViewController causing error

I have the below Swift 2 code set up that captures all touches across the whole app. It alerts when touches are occurring and when touches have stopped. I am wanting to access two functions in another view controller named myVC when touches are…
user4806509
  • 2,925
  • 5
  • 37
  • 72
-1
votes
1 answer

UIEvent: how to copy (not referencing)?

I need to copy a UIEvent in order to forward it to a UIView (UIWebView) at a later time. Is this possible? And if so, how can I achieve it? example subclass of main UIWindow UIEvent *startEvent; - (void)sendEvent:(UIEvent *)event { NSSet *touches =…
user3159270
  • 119
  • 2
  • 10
-1
votes
1 answer

How to control the iphone power button programmatically?

I want to control the iphone device programmatically. I mean,when user want to switch off the phone one alert message will come.it will ask the password then only the operation will work. when user delete the app from the his/her device one alert…
srinadh
  • 123
  • 3
  • 11
1 2 3 4 5 6 7
8