How to know when a UISwitch is being touched
How to know when a UISwitch is being touched
- Subject: How to know when a UISwitch is being touched
- From: Joan Lluch-Zorrilla <email@hidden>
- Date: Tue, 31 Mar 2009 15:22:00 +0200
I need to know whether the user is touching inside a UISwitch control.
The UIControlEvent(s) do fire, but then isTouchInside always gives NO.
My code is:
- (void)switchTouched:(UIControl *)sender
{
NSLog( @"switchtouched:%d", [sender isTouchInside]) ;
}
The switchTouched method was added as a target to touch events upon
creation of the switch like this
[switchv addTarget:self action:@selector(switchTouched:)
forControlEvents:UIControlEventAllTouchEvents] ;
Whatever the user does on the switch the result is always Zero. What
am I missing?
Joan Lluch-Zorrilla
_______________________________________________
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