Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved example #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Doc/lefthidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/leftrevealed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified ViewDeckStoryboardExample/AppDelegate.h
100644 → 100755
Empty file.
Empty file modified ViewDeckStoryboardExample/AppDelegate.m
100644 → 100755
Empty file.
Empty file modified ViewDeckStoryboardExample/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified ViewDeckStoryboardExample/Default.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified ViewDeckStoryboardExample/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions ViewDeckStoryboardExample/FirstViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <UIKit/UIKit.h>

@interface FirstViewController : UIViewController

@end
45 changes: 45 additions & 0 deletions ViewDeckStoryboardExample/FirstViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#import "FirstViewController.h"
#import <ViewDeck/IIViewDeckController.h>

@interface FirstViewController ()

@end

@implementation FirstViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}


- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:YES];
// Do any additional setup after loading the view.
}



- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (IBAction)revealSidebar:(UIBarButtonItem *)sender {
// Open menu
[self.viewDeckController toggleLeftViewAnimated:YES];
}

@end
Empty file modified ViewDeckStoryboardExample/InitialViewController.h
100644 → 100755
Empty file.
8 changes: 5 additions & 3 deletions ViewDeckStoryboardExample/InitialViewController.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ @implementation InitialViewController
- (id)initWithCoder:(NSCoder *)aDecoder
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
self = [super initWithCenterViewController:[storyboard instantiateViewControllerWithIdentifier:@"middleViewController"]
self = [super initWithCenterViewController:[storyboard instantiateViewControllerWithIdentifier:@"firstViewController"]
leftViewController:[storyboard instantiateViewControllerWithIdentifier:@"leftViewController"]];
if (self) {
// Add any extra init code here

// Put your settings for ViewDeck here
self.openSlideAnimationDuration = 0.3f; // In seconds
self.closeSlideAnimationDuration = 0.3f;
}
return self;
}


@end
8 changes: 8 additions & 0 deletions ViewDeckStoryboardExample/MenuViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#import <UIKit/UIKit.h>

@interface MenuViewController : UITableViewController

@property (nonatomic, retain) UIViewController *firstview;


@end
65 changes: 65 additions & 0 deletions ViewDeckStoryboardExample/MenuViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#import "MenuViewController.h"
#import <ViewDeck/IIViewDeckController.h>

@interface MenuViewController ()

@end


@implementation MenuViewController

@synthesize firstview;

- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
/*Change view*/
switch (indexPath.row) {
case 0:
{
// This way we save the state of the navigation controller
if (!self.firstview) {
self.firstview = (UINavigationController*) [self.storyboard instantiateViewControllerWithIdentifier:@"firstViewController"];
}

[self.viewDeckController setCenterController:self.firstview];
[self.viewDeckController closeLeftViewAnimated:YES];

break;
}
case 1:
{
// Add a closing bounce effect
// Will create a new instance of the navigation controller each time it is called
[self.viewDeckController closeLeftViewBouncing:^(IIViewDeckController *controller) {
controller.closeSlideAnimationDuration = 0.1f;
controller.openSlideAnimationDuration = 0.2f;
[controller setCenterController:[self.storyboard instantiateViewControllerWithIdentifier:@"secondViewController"]];
}];
break;
}
}
}

@end
16 changes: 0 additions & 16 deletions ViewDeckStoryboardExample/MiddleViewController.h

This file was deleted.

37 changes: 0 additions & 37 deletions ViewDeckStoryboardExample/MiddleViewController.m

This file was deleted.

5 changes: 5 additions & 0 deletions ViewDeckStoryboardExample/SecondViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <UIKit/UIKit.h>

@interface SecondViewController : UIViewController

@end
41 changes: 41 additions & 0 deletions ViewDeckStoryboardExample/SecondViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#import "SecondViewController.h"
#import <ViewDeck/IIViewDeckController.h>

@interface SecondViewController ()

@end

@implementation SecondViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:YES];
// Do any additional setup after loading the view.
}

- (IBAction)revealSidebar:(UIBarButtonItem *)sender {
// Open menu
[self.viewDeckController toggleLeftViewAnimated:YES];
}

@end
Empty file modified ViewDeckStoryboardExample/ViewDeckStoryboardExample-Info.plist
100644 → 100755
Empty file.
Empty file modified ViewDeckStoryboardExample/ViewDeckStoryboardExample-Prefix.pch
100644 → 100755
Empty file.
Empty file modified ViewDeckStoryboardExample/en.lproj/InfoPlist.strings
100644 → 100755
Empty file.
Loading