bdbergeron / bdbpopupviewcontroller Goto Github PK
View Code? Open in Web Editor NEWA UIViewController category for presenting custom view controllers modally.
License: MIT License
A UIViewController category for presenting custom view controllers modally.
License: MIT License
For example, I changed your demo to allow opening another version of the main view controller with FormSheet presentation style, run it on iPod. Hit the nav bar button to open the form view controller and press the button, the popup is opened behind the form view controller's view instead of over top of it.
@interface MainViewController ()
@property (nonatomic, assign, getter=isForm) BOOL form;
@end
@interface FormNavigationViewController : UINavigationController
@end
#pragma mark -
@implementation MainViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = NSLocalizedString(@"Popup Demo", nil);
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.f) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
UIBarButtonItem *barButton;
if (!self.form)
barButton = [[UIBarButtonItem alloc] initWithTitle:@"Form" style:UIBarButtonItemStylePlain target:self action:@selector(openForm)];
else
barButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self action:@selector(dismissForm)];
barButton.tintColor = [UIColor whiteColor];
self.navigationItem.rightBarButtonItem = barButton;
}
}
- (IBAction)showInfo:(UIButton *)sender
{
[self bdb_presentPopupViewController:[AboutViewController new]
withAnimation:BDBPopupViewShowAnimationZoomIn
completion:nil];
}
- (void)openForm
{
MainViewController *containedViewController = [MainViewController new];
containedViewController.form = YES;
UIViewController *form = [[FormNavigationViewController alloc] initWithRootViewController:containedViewController];
[self presentViewController:form animated:YES completion:nil];
}
- (void)dismissForm
{
[self dismissViewControllerAnimated:YES completion:nil];
}
@end
#pragma mark -
@implementation FormNavigationViewController
- (UIModalPresentationStyle)modalPresentationStyle
{
return UIModalPresentationFormSheet;
}
@end```
Pressing back button on a pushed view controller does nothing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.