Re: iOS - Proper way to check UIEvent or UInternalEvent
Re: iOS - Proper way to check UIEvent or UInternalEvent
- Subject: Re: iOS - Proper way to check UIEvent or UInternalEvent
- From: Alex Zavatone <email@hidden>
- Date: Tue, 23 Jun 2015 22:31:47 -0400
On Jun 23, 2015, at 9:27 PM, Kyle Sluder wrote:
>> On Jun 23, 2015, at 6:10 PM, Alex Zavatone <email@hidden> wrote:
>>
>> Actually, the rotate event is the one that is being caught and sent.
>>
>> If it's a UIEvent and it's listed as a UIInternalEvent, within the debugger, how do I check the type and subtype to see what type of event it is so that I can return immediately if it is the wrong type?
>
> I don’t understand the question. Or rather, I understand the question, but I don’t understand why you are asking it.
Because an exception is thrown in that case and I'd prefer to return before my app quits.
> There are three public types of event: Touches, Motion, and RemoteControl. Are you saying that UIInternalEvents are re-using one of these constants, and therefore you need an alternative way to disambiguate them? That’s definitely a problem and you should file a Radar.
I'm saying "I want to see which event it is and return if it is a motion event".
>
> If you just want to spelunk around the innards of a private UIEvent subclass, then no. We will not provide you information to do so.
>
> Barring that, just do if (event.type==UIEventTypeMotion) { } else if (event.type==UIEventTypeTouches) { } …
Yeah, I tried that. The event.type is returning -1 and isn't matching any of the 3 UIEventType enum values. It's not matching on any of them.
I threw it in a switch/case statement and the event.type isn't matching on any of them and falls through to default:.
> --Kyle Sluder
>
>
>>
>>> On Jun 23, 2015, at 7:35 PM, Kyle Sluder wrote:
>>>
>>>> On Tue, Jun 23, 2015, at 02:54 PM, Alex Zavatone wrote:
>>>> We don't care about motion events. We only care about touch events.
>>>>
>>>> I'm trying to check if the event is a of UIEventTypeMotion and simply
>>>> return.
>>>
>>> If you only care about touch events, why aren't you comparing against
>>> UIEventTypeTouches?
>>>
>>> --Kyle Sluder
>>> _______________________________________________
>>>
>>> Cocoa-dev mailing list (email@hidden)
>>>
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden