March 2014
Intermediate to advanced
672 pages
40h 11m
English
A custom overlay can present information as well as limit interaction. You can easily expand the overlay approach from Recipe 3-3 so that the view dismisses itself on a touch. When tapped, the view removes itself from the screen. This behavior makes the view particularly suitable for showing information in a way normally reserved for the UIAlertView class:
@interface TappableOverlay : UIView @end @implementation TappableOverlay - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { // Remove this view when it is touched [self removeFromSuperview]; } @end
Read now
Unlock full access