This repository has been archived by the owner on Dec 16, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attention: The previous version lives in the legacy branch. This is a bulk commit. The interface has changed and project was updated for the current iOS SDK. This version is untested and has most definitely bugs. Signed-off-by: Marcel Dierkes <marcel.dierkes@gmail.com>
- Loading branch information
Showing
39 changed files
with
1,098 additions
and
5,928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
// | ||
// ViewController.h | ||
// LeftViewController.h | ||
// MKDSlideViewController | ||
// | ||
// Created by Marcel Dierkes on 03.12.11. | ||
// Copyright (c) 2011 __MyCompanyName__. All rights reserved. | ||
// Created by Marcel Dierkes on 18.04.13. | ||
// | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface LeftViewController : UIViewController | ||
|
||
@property (nonatomic, assign) UIViewController * mainViewController; | ||
|
||
- (IBAction)changeText:(id)sender; | ||
- (IBAction)navigateToMainViewController:(id)sender; | ||
- (IBAction)navigateToRightViewController:(id)sender; | ||
@interface LeftViewController : UITableViewController | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,49 @@ | ||
// | ||
// ViewController.m | ||
// LeftViewController.m | ||
// MKDSlideViewController | ||
// | ||
// Created by Marcel Dierkes on 03.12.11. | ||
// Copyright (c) 2011 __MyCompanyName__. All rights reserved. | ||
// Created by Marcel Dierkes on 18.04.13. | ||
// | ||
// | ||
|
||
#import "LeftViewController.h" | ||
#import "MainViewController.h" | ||
#import "AppDelegate.h" | ||
#import "MKDSlideViewController.h" | ||
#import "UIViewController+MKDSlideViewController.h" | ||
#import "MainViewController.h" | ||
#import "SecondaryViewController.h" | ||
|
||
@implementation LeftViewController | ||
|
||
@synthesize mainViewController = _mainViewController; | ||
|
||
- (void)didReceiveMemoryWarning | ||
{ | ||
[super didReceiveMemoryWarning]; | ||
// Release any cached data, images, etc that aren't in use. | ||
} | ||
|
||
#pragma mark - View lifecycle | ||
|
||
- (void)viewDidLoad | ||
{ | ||
[super viewDidLoad]; | ||
// Do any additional setup after loading the view, typically from a nib. | ||
} | ||
|
||
- (void)viewDidUnload | ||
{ | ||
[super viewDidUnload]; | ||
// Release any retained subviews of the main view. | ||
// e.g. self.myOutlet = nil; | ||
self.mainViewController = nil; | ||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated | ||
{ | ||
[super viewWillAppear:animated]; | ||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated | ||
{ | ||
[super viewDidAppear:animated]; | ||
} | ||
|
||
- (void)viewWillDisappear:(BOOL)animated | ||
{ | ||
[super viewWillDisappear:animated]; | ||
} | ||
#pragma mark - Table view delegate | ||
|
||
- (void)viewDidDisappear:(BOOL)animated | ||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
[super viewDidDisappear:animated]; | ||
} | ||
|
||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | ||
{ | ||
// Return YES for supported orientations | ||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { | ||
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); | ||
} else { | ||
return YES; | ||
NSUInteger row = [indexPath row]; | ||
|
||
UINavigationController * centerNavigationController = (UINavigationController *)self.navigationController.slideViewController.mainViewController; | ||
|
||
if( row == 0 ) | ||
{ | ||
if( [centerNavigationController.topViewController isKindOfClass:[MainViewController class]] ) | ||
[self.navigationController.slideViewController showMainViewControllerAnimated:YES]; | ||
else | ||
{ | ||
UIViewController * mainViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"MainViewController"]; | ||
[self.navigationController.slideViewController setMainViewController:mainViewController animated:YES]; | ||
} | ||
} | ||
} | ||
|
||
#pragma mark - | ||
|
||
- (IBAction)changeText:(id)sender | ||
{ | ||
MainViewController * main = (MainViewController *)self.mainViewController; | ||
if( self.mainViewController ) | ||
else if( row == 1 ) | ||
{ | ||
[main setDetailText:@"Pressed a button…"]; | ||
if( [centerNavigationController.topViewController isKindOfClass:[SecondaryViewController class]] ) | ||
[self.navigationController.slideViewController showMainViewControllerAnimated:YES]; | ||
else | ||
{ | ||
UIViewController * secondaryViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"SecondaryViewController"]; | ||
[self.navigationController.slideViewController setMainViewController:secondaryViewController animated:YES]; | ||
} | ||
} | ||
} | ||
|
||
- (IBAction)navigateToMainViewController:(id)sender | ||
{ | ||
// Use the application delegate to interact with the Slide View Controller | ||
AppDelegate * appDelegate = [[UIApplication sharedApplication] delegate]; | ||
MKDSlideViewController * slideViewController = appDelegate.slideViewController; | ||
[slideViewController showMainViewController:self]; | ||
} | ||
|
||
- (IBAction)navigateToRightViewController:(id)sender | ||
{ | ||
// Use the application delegate to interact with the Slide View Controller | ||
AppDelegate * appDelegate = [[UIApplication sharedApplication] delegate]; | ||
MKDSlideViewController * slideViewController = appDelegate.slideViewController; | ||
[slideViewController showRightViewController:self]; | ||
|
||
[tableView deselectRowAtIndexPath:indexPath animated:YES]; | ||
} | ||
|
||
@end |
Oops, something went wrong.