About

This is the developer blog of Simon Wolf, Mac and iPhone developer, owner of Otter Software Ltd.

I am currently available for contract work so please get in touch to see if I can help you.

Twitter Accounts
Main
Sunday
Feb142010

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

    OTSOverlayView

    Information

    Version: 1.0
    Released: 15 February 2010
    Minimum OS: OS X 10.5

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>