dimitar-lazarov / NAModalSheet

NAModalSheet - present your own view modally with a blurred version of the background showing through

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

##NAModalSheet

NAModalSheet presents your view controller with a blurred image of the background behind it - tested on iOS 6 and 7, but should be deployable on iOS 5.

###Usage

  • You should link with the Accelerate.framework when using NAModalSheet

Initialize an NAModalSheet with your view controller and the presentation style: sheets can slide on from the top or bottom, or fade in centered.

//Create a view controller to display as a sheet  
SampleSheetViewController *svc = [[SampleSheetViewController alloc] init];


//Initialize an NAModalSheet view controller with it
NAModalSheet *sheet = [[NAModalSheet alloc] initWithViewController:svc presentationStyle:NAModalSheetPresentationStyleSlideInFromTop];
  
[sheet presentWithCompletion:^{
	// block called when your view is fully presented
}];

Specify an inset value before presenting if using a sliding presentation style. This causes the view to slide in at the given distance from the edge of the screen. You could use this to make it appear as if the view is sliding out from under the navigation bar.

sheet.slideInset = [[UIApplication sharedApplication] statusBarFrame].size.height + self.navigationController.navigationBar.frame.size.height;

The view you present should be translucent to allow the blurred background image to show through. White at 50% opacity works well.

###Credits

The box blur code was presented publicly in a blog post on IndieAmbitions.com:

http://indieambitions.com/idevblogaday/perform-blur-vimage-accelerate-framework-tutorial

About

NAModalSheet - present your own view modally with a blurred version of the background showing through

License:MIT License


Languages

Language:Objective-C 100.0%