Skip to content

Commit

Permalink
first commit, with a working menu controller. uses containment view
Browse files Browse the repository at this point in the history
  • Loading branch information
honcheng committed Oct 26, 2012
1 parent d45b0f0 commit df693d0
Show file tree
Hide file tree
Showing 22 changed files with 970 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "PaperFoldMenuController/PaperFold"]
path = PaperFoldMenuController/PaperFold
url = https://github.com/honcheng/PaperFold-for-iOS.git
406 changes: 406 additions & 0 deletions Demo/Demo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions Demo/Demo/AppDelegate.h
@@ -0,0 +1,16 @@
//
// AppDelegate.h
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

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

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, strong) DemoMenuController *menuController;
@end
47 changes: 47 additions & 0 deletions Demo/Demo/AppDelegate.m
@@ -0,0 +1,47 @@
//
// AppDelegate.m
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import "AppDelegate.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
#import "ThirdViewController.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

_menuController = [[DemoMenuController alloc] initWithMenuWidth:250.0];
[self.window setRootViewController:_menuController];

NSMutableArray *viewControllers = [NSMutableArray array];

FirstViewController *firstViewController = [[FirstViewController alloc] init];
[firstViewController setTitle:@"First View Controller"];
UINavigationController *firstNavController = [[UINavigationController alloc] initWithRootViewController:firstViewController];
[viewControllers addObject:firstNavController];

SecondViewController *secondViewController = [[SecondViewController alloc] init];
[secondViewController setTitle:@"Second View Controller"];
UINavigationController *secondNavController = [[UINavigationController alloc] initWithRootViewController:secondViewController];
[viewControllers addObject:secondNavController];

ThirdViewController *thirdViewController = [[ThirdViewController alloc] init];
[thirdViewController setTitle:@"Third View Controller"];
UINavigationController *thirdNavController = [[UINavigationController alloc] initWithRootViewController:thirdViewController];
[viewControllers addObject:thirdNavController];

[_menuController setViewControllers:viewControllers];

self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}

@end
Binary file added Demo/Demo/Default-568h@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Demo/Demo/Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Demo/Demo/Default@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions Demo/Demo/Demo-Info.plist
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.honcheng.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
14 changes: 14 additions & 0 deletions Demo/Demo/Demo-Prefix.pch
@@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'Demo' target in the 'Demo' project
//

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
14 changes: 14 additions & 0 deletions Demo/Demo/DemoMenuController.h
@@ -0,0 +1,14 @@
//
// DemoMenuController.h
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

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

@interface DemoMenuController : PaperFoldMenuController

@end
38 changes: 38 additions & 0 deletions Demo/Demo/DemoMenuController.m
@@ -0,0 +1,38 @@
//
// DemoMenuController.m
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import "DemoMenuController.h"

@interface DemoMenuController ()

@end

@implementation DemoMenuController

- (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.
}

@end
13 changes: 13 additions & 0 deletions Demo/Demo/FirstViewController.h
@@ -0,0 +1,13 @@
//
// FirstViewController.h
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface FirstViewController : UIViewController

@end
38 changes: 38 additions & 0 deletions Demo/Demo/FirstViewController.m
@@ -0,0 +1,38 @@
//
// FirstViewController.m
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import "FirstViewController.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)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end
13 changes: 13 additions & 0 deletions Demo/Demo/SecondViewController.h
@@ -0,0 +1,13 @@
//
// SecondViewController.h
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface SecondViewController : UIViewController

@end
38 changes: 38 additions & 0 deletions Demo/Demo/SecondViewController.m
@@ -0,0 +1,38 @@
//
// SecondViewController.m
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import "SecondViewController.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.
}

@end
13 changes: 13 additions & 0 deletions Demo/Demo/ThirdViewController.h
@@ -0,0 +1,13 @@
//
// ThirdViewController.h
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ThirdViewController : UIViewController

@end
38 changes: 38 additions & 0 deletions Demo/Demo/ThirdViewController.m
@@ -0,0 +1,38 @@
//
// ThirdViewController.m
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import "ThirdViewController.h"

@interface ThirdViewController ()

@end

@implementation ThirdViewController

- (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.
}

@end
2 changes: 2 additions & 0 deletions Demo/Demo/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

18 changes: 18 additions & 0 deletions Demo/Demo/main.m
@@ -0,0 +1,18 @@
//
// main.m
// Demo
//
// Created by honcheng on 26/10/12.
// Copyright (c) 2012 Hon Cheng Muh. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
1 change: 1 addition & 0 deletions PaperFoldMenuController/PaperFold
Submodule PaperFold added at 8b52c9

0 comments on commit df693d0

Please sign in to comment.