When a user taps a button on my interface, I want to create an image of the screen using renderInContext:
However, the image is created with the button in it’s ‘pressed’ state – that is, the UIControlStateHighlighted image is used.
Is there some way to wait for this button to revert back to the UIControlStateNormal state before I create the image?
If not, the only other solution I can think of is recreating the view off screen, and imaging that.
P.S I would rather avoid using some arbitrary timer to wait a set interval.
Create and replace your button with a subclassed button and trigger your renderInContext when the
method is called. This method is called when the user lifts their finger off the button.
Or set an action method of the existing button using this method of uibutton:
with the control event set to UIControlEventTouchUpInside