Skip to content

This project provides a overlay for your views that provide a spotlight effect on whatever aspect of the view you want to point out. Very useful for tutorial screens.

Notifications You must be signed in to change notification settings

rgerard/iphone-spotlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Spotlight Overlay

The spotlight overlay is useful in isolating specific aspects of an iPhone view with a spotlight effect. The overlay puts a semi-transparent black background over the view that this overlay is added to, and puts a spotlight over whatever part of the view you want isolated. In addition, there is a button that can be placed on the view that acts as a way to transition from one spotlight to the next (animated, of course).

Usage

  • This project was built with ARC, for iOS 5
  • Import the view controller: #import "SpotlightViewController.h"
  • Have the view controller using this object conform to the SpotlightViewControllerDelegate protocol: UIViewController
  • Create the SpotlightViewController object, set the delegate, and add the view
  • Call animateSpotlight to set where you want the button to appear, where you want the spotlight to be, and the size (radius) of the spotlight

Example

// Create the spotlight overview, and set this class as the delegate
self.spotlightViewController = [[SpotlightViewController alloc] init];
[self.spotlightViewController setDelegate:self];
[self.view addSubview:self.spotlightViewController.view];

// Animate the spotlight to its first location
// This call will set the frame of the button to CGRectMake(35, 80, 250, 60), with the text "Testing!".  It will place the spotlight center at point (150, 260), with a radius of 80 pts
[self.spotlightViewController animateSpotlight:CGRectMake(35, 80, 250, 60) withButtonText:@"Testing!" withSpotlightCenter:CGPointMake(150, 260) withSpotlightRadius:80];

Screenshot

Spotlight in action

About

This project provides a overlay for your views that provide a spotlight effect on whatever aspect of the view you want to point out. Very useful for tutorial screens.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published