romaonthego / REFrostedViewController

iOS 7/8 style blurred view controller that appears on top of your view controller.
MIT License
2.97k stars 494 forks source link

Open a UIStoryboard with Identifier from AppDelegate with REFrostedViewController #97

Closed core-design closed 10 years ago

core-design commented 10 years ago

Hello, in the AppDelegate I would like to open by an Alert View link to a storyboard with identifer.

This also works wonderfully. However, the REFrostedMenue will not load when clicking on the menu button?

I think I forget when switching pages to load the menu?

Unfortunately I program only a few months to fix the error yourself.

Best Thank you, Christopher - Austria

// AppDelegate.m

#import "AppDelegate.h"
#import "NewsTab.h"

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
NewsTab *NewsTabController=[[UIStoryboard storyboardWithName:[NSString stringWithFormat:@"Main_%@", deviceType] bundle:nil] instantiateViewControllerWithIdentifier:@"NewsViewController"];

UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:NewsTabController];
self.window.rootViewController = navController;
}

// NewsTab.h

#import <UIKit/UIKit.h>
#import "REFrostedViewController.h"

@interface NewsTab : UITableViewController <UITableViewDelegate, UITableViewDataSource>

- (IBAction)ButtonshowMenu:(id)sender;

@end

// NewsTab.m

- (IBAction)ButtonshowMenu:(id)sender {
NSLog(@"Go Go Go");
[self.view endEditing:YES];
[self.frostedViewController.view endEditing:YES];
[self.frostedViewController presentMenuViewController];
}