0

Please help me in my project. I am using IIViewDeckController but its not working when pushed by view controller

Heres the hierarchy:

ViewController (Push)----> IIViewDeckController (with Left and centerview).

Here is my code when initialising the IIViewDeckController:

- (IIViewDeckController*)generateControllerStack{

self.navigationView = [[NavigationViewController alloc] initWithNibName:@"NavigationViewController" bundle:nil];
self.profileView = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];

UINavigationController* navC = [[UINavigationController alloc] initWithRootViewController:self.profileView];


IIViewDeckController *deckView = [[IIViewDeckController alloc] initWithCenterViewController:navC leftViewController:self.navigationView rightViewController:nil];

deckView.leftSize = 50;

[deckView disablePanOverViewsOfClass:NSClassFromString(@"_UITableViewHeaderFooterContentView")];

return deckView;

}

then this is my code when I'm pushing IIViewDeckController using another ViewController

- (IBAction)signInAction:(id)sender {

IIViewDeckController *deckView = [[UIManager sharedItems] generateControllerStack];

[self.navigationController pushViewController:deckView animated:YES];

}

Thanks you very much guys :)

enter image description here

when I clicked sign in which is I will push my iiviewdeckcontroller with left and centre view this appears

enter image description here

user3205472
  • 175
  • 1
  • 1
  • 7
  • Show some code what you've done and what is the issue. – ChintaN -Maddy- Ramani Oct 06 '15 at 07:09
  • Hi! I follow the same instructions given in the documents i just add a view controller as home page. when I clicked the button it will pushed iiviewdeckcontroller with left and centerview. It appears that the centerview is not showing. – user3205472 Oct 06 '15 at 07:12
  • Its better to show it by screen shot or coding rather than textually... – Piyush Oct 06 '15 at 07:14
  • you want to push viewcontroller or just want to push like side menu? – Piyush Oct 06 '15 at 07:16
  • I have a view controller and a button with it. I will push IIviewdeckController with left and centerview. using the button in the view controller. my problem is the iiviewdeckcontroller is not working it appears that the centre view is not showing. – user3205472 Oct 06 '15 at 07:22
  • Check again, if you have setup the centre and left viewcontrollers properly – zaheer Oct 06 '15 at 07:26

3 Answers3

0

You can do like that.

//Appdelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController"
                                                       bundle:nil];
UINavigationController *navigation = [[UINavigationController alloc]initWithRootViewController:self.viewController];
self.window.rootViewController = navigation;
[self.window makeKeyAndVisible];
return YES;

}

import IIViewDeckController.h in ViewController.h then

- (IBAction)GoToNext:(id)sender 
{
        IIViewDeckController *objIIVC = [self.storyboard instantiateViewControllerWithIdentifier:@"Your VC's Identifier"];
        [self.navigationController pushViewController:objIIVC animated:YES];

}
Piyush
  • 1,534
  • 12
  • 32
0

Did you created it like this? I am using it as root view controller. and it is working fine

    UINavigationController* navController=(UINavigationController*)[[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"HomeViewController"];

    SlideMenuViewController* slide=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"SlideMenuViewController"]; /


    IIViewDeckController* deckController =  [[IIViewDeckController alloc] initWithCenterViewController:navController
                                                                                    leftViewController:slide
                                                                                   rightViewController:nil
                                                                                     topViewController:nil
                                                                                  bottomViewController:nil];

    float leftSize=self.window.frame.size.width - (88*self.window.frame.size.width)/320;
    deckController.panningMode = IIViewDeckFullViewPanning;
    deckController.leftSize =leftSize;
zaheer
  • 893
  • 13
  • 27
0

Here is my code

- (IIViewDeckController*)generateControllerStack{

self.navigationView = [[NavigationViewController alloc] initWithNibName:@"NavigationViewController" bundle:nil];


UIViewController *centerController = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
centerController = [[UINavigationController alloc] initWithRootViewController:centerController];


self.viewDeck = [[IIViewDeckController alloc] initWithCenterViewController:centerController leftViewController:self.navigationView rightViewController:nil topViewController:nil bottomViewController:nil];

self.viewDeck.leftSize = 50;

[self.viewDeck disablePanOverViewsOfClass:NSClassFromString(@"_UITableViewHeaderFooterContentView")];

return self.viewDeck;

}

user3205472
  • 175
  • 1
  • 1
  • 7
  • The issue is in 4th, line, change that to "UINavigationController* navC = [[UINavigationController alloc] initWithRootViewController:centerController];" – zaheer Oct 06 '15 at 09:30
  • its still not working :( I can't move on to my project because of this problem :( – user3205472 Oct 07 '15 at 02:54