OTSOverlayView
Description
OTSOverlayView allows you to overlay one view on top of another. The code has been inspired by two personal requirements. The first was to be able to ‘lock-down’ the interface of Digestive when Bento was running because of the potential issues that could be caused by using both applications simultaneously. The second was a need to prevent users from interacting with a window whilst some background tasks were being performed. Items such as the background colour, opacity and blur effect of the overlay are fully customisable and when you dismiss the overlay the focus returns to the control previously selected in the underlying view.
Features
- Assign a background colour to the overlay view which can include an alpha value for transparency.
- Assign a blur factor to blur the contents of the view behind the overlay.
- The overlay view fades in and out.
Example Usage
Displaying the overlay view.
- (IBAction)showOverlay:(id)sender;
{
[overlayView displayUsingPixelRadiusBlur:1.0
withOverlayRed:0.5
green:0.0
blue:0.5
alpha:0.4];
}
Removing the overlay view.
- (IBAction)hideOverlay:(id)sender;
{
[overlayView removeFromView];
}
Things To Watch Out For
- You need to create an IBOutlet for the OTSOverlayView and you need to hook the IBOutlet that is in the OTSOverlayView to the view you want to overlay.
- You do not need to layer-back your views in advance, OTSOverlayView will do that for you.
Screenshots

Download
Information
Version: 1.0
Released: 15 February 2010
Minimum OS: OS X 10.5
blur,
core animation,
fade,
nsview,
overlay,
transparency