Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is not possible directly as the event triggered will not be for the button as button is not visible (ie. another View is completly covering the button and is blocking the interaction with the user). But i can give u a work around.</p> <p>1.Declare a Bool Variable in your UIViewController 2.Implement the touches methods as shown below</p> <pre><code>- (void)touchesBegin:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch=[touches anyObject]; CGPoint p=[touch locationInView:self.view]; if(CGRectContainsPoint(button.frame, p) &amp;&amp; !boolVariable) { boolVariable = YES; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch=[touches anyObject]; CGPoint p=[touch locationInView:self.view]; // If the below condition is true then it mean there the user tapped on the same location as that of button..(touchesEnded and touchesCanceled was not called) so the event is just like touchUpInside if(CGRectContainsPoint(button.frame, p) &amp;&amp; boolVariable) { boolVariable = NO; [Here you can call the method which you wanted to call on touchUpInside of the button]; } } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { boolVariable = NO; } - (void)touchesCanceled:(NSSet *)touches withEvent:(UIEvent *)event { boolVariable = NO; } </code></pre> <p>I was not able to test the able code on Xcode but i think it will work.. Note: The frame of the button should be with respect to the UIViewController. Hope this helps u out :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload