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

My source code is subject to some license terms.

The full details can be found on the Source Code License page but in summary:

  • You can modify the code as you wish, and use the modified code in your products.
  • You can redistribute the original, unmodified code, but you have to include the full license text.
  • You can redistribute the modified code as you wish without the full license text.
  • In all cases, you must include a credit mentioning Simon Wolf as the original author of the source.
  • I’m not liable for anything you do with the code.
  • I’m not responsible for any harm the code may cause.
  • You can’t use my name or other marks to promote your products based on the code.
  • If you agree to all of that, go ahead and download the source. Otherwise, don’t.

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