I want to create a UIButton that can be held down, when held down it calls the "hold down" action once. when it is released, calls the "hold was release" action.
This code isn't working correctly because the touch can move inside the button and the events aren't triggered in correct order
[button handleControlEvent:UIControlEventTouchDown withBlock:^{
[self performMomentaryAction:PXActionTypeTouchDown];
}];
[button handleControlEvent:UIControlEventTouchUpInside withBlock:^{
[self performMomentaryAction:PXActionTypeTouchUp];
}];
handle control events is based on UIBUtton+block implementation
Try this
Add TouchDown ,Touch Up Inside, Touch Up Outside event to ur button