Skip to content

Lunarpad/ObjC-Modals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Modals

Description

A view controller module for displaying floating modal views within your iOS app.

Installation

Simply plop this repo into your project, and you should be good to go.

Sample usage

UIViewController *customContentViewController = [[UIViewController alloc] init];
customContentViewController.view.frame = CGRectMake(10, 20, 300, 200); // set intended 'visible' frame
customContentViewController.view.backgroundColor = [UIColor white];
customContentViewController.view.layer.masksToBounds = YES;
customContentViewController.view.layer.cornerRadius = 6;

LPModalViewController *modalViewController = [[BZModalViewController alloc] init];
[modalViewController useContentViewController:myModalContentViewController];

modalViewController.revealTransition = LPModalTransitionSlideUp;
modalViewController.dismissTransition = LPModalTransitionSlideDown;

[modalViewController revealWithCompletion:^(BOOL finished) {}];

…

[modalViewController dismissWithCompletion:^(BOOL finished) {}];

Transitions

typedef enum {
    LPModalTransitionFade,
    LPModalTransitionNone,
    LPModalTransitionSlideUp,
    LPModalTransitionSlideDown
} LPModalTransition;

Subclassing

LPModalViewController is subclassable! Subclassing is great for customizing modal transitions and subview appearance.

About

Floating modal views in your iOS app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published