forked from honcheng/PaperFold-for-iOS
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
818 additions
and
0 deletions.
There are no files selected for viewing
348 changes: 348 additions & 0 deletions
348
PaperFold-ContainmentView/PaperFold-ContainmentView.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
PaperFold-ContainmentView/PaperFold-ContainmentView/AppDelegate.h
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// AppDelegate.h | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface AppDelegate : UIResponder <UIApplicationDelegate> | ||
|
||
@property (strong, nonatomic) UIWindow *window; | ||
|
||
@end |
69 changes: 69 additions & 0 deletions
69
PaperFold-ContainmentView/PaperFold-ContainmentView/AppDelegate.m
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// | ||
// AppDelegate.m | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import "AppDelegate.h" | ||
#import "PaperFoldNavigationController.h" | ||
#import "ContentViewController.h" | ||
#import "LeftViewController.h" | ||
#import "RightViewController.h" | ||
|
||
@implementation AppDelegate | ||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
{ | ||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | ||
// Override point for customization after application launch. | ||
self.window.backgroundColor = [UIColor whiteColor]; | ||
[self.window makeKeyAndVisible]; | ||
|
||
ContentViewController *contentViewController = [[ContentViewController alloc] initWithStyle:UITableViewStylePlain]; | ||
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:contentViewController]; | ||
PaperFoldNavigationController *paperFoldNavController = [[PaperFoldNavigationController alloc] initWithRootViewController:navController]; | ||
[self.window setRootViewController:paperFoldNavController]; | ||
|
||
LeftViewController *leftViewController = [[LeftViewController alloc] init]; | ||
UINavigationController *leftNavController = [[UINavigationController alloc] initWithRootViewController:leftViewController]; | ||
[leftNavController setNavigationBarHidden:YES]; | ||
[paperFoldNavController setLeftViewController:leftNavController width:150]; | ||
|
||
RightViewController *rightViewController = [[RightViewController alloc] init]; | ||
UINavigationController *rightNavController = [[UINavigationController alloc] initWithRootViewController:rightViewController]; | ||
[rightNavController setNavigationBarHidden:YES]; | ||
[paperFoldNavController setRightViewController:rightNavController width:250.0 rightViewFoldCount:3 rightViewPullFactor:0.9]; | ||
|
||
return YES; | ||
} | ||
|
||
- (void)applicationWillResignActive:(UIApplication *)application | ||
{ | ||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. | ||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. | ||
} | ||
|
||
- (void)applicationDidEnterBackground:(UIApplication *)application | ||
{ | ||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. | ||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | ||
} | ||
|
||
- (void)applicationWillEnterForeground:(UIApplication *)application | ||
{ | ||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. | ||
} | ||
|
||
- (void)applicationDidBecomeActive:(UIApplication *)application | ||
{ | ||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. | ||
} | ||
|
||
- (void)applicationWillTerminate:(UIApplication *)application | ||
{ | ||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | ||
} | ||
|
||
@end |
13 changes: 13 additions & 0 deletions
13
PaperFold-ContainmentView/PaperFold-ContainmentView/ContentViewController.h
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// ContentViewController.h | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface ContentViewController : UITableViewController | ||
|
||
@end |
55 changes: 55 additions & 0 deletions
55
PaperFold-ContainmentView/PaperFold-ContainmentView/ContentViewController.m
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// ContentViewController.m | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import "ContentViewController.h" | ||
|
||
@interface ContentViewController () | ||
|
||
@end | ||
|
||
@implementation ContentViewController | ||
|
||
- (id)initWithStyle:(UITableViewStyle)style | ||
{ | ||
self = [super initWithStyle:style]; | ||
if (self) { | ||
// Custom initialization | ||
} | ||
return self; | ||
} | ||
|
||
|
||
#pragma mark - Table view data source | ||
|
||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
{ | ||
return 1; | ||
} | ||
|
||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
{ | ||
return 10; | ||
} | ||
|
||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
static NSString *CellIdentifier = @"Cell"; | ||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | ||
if (!cell) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; | ||
return cell; | ||
} | ||
|
||
#pragma mark - Table view delegate | ||
|
||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
UITableViewController *viewController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain]; | ||
[self.navigationController pushViewController:viewController animated:YES]; | ||
} | ||
|
||
@end |
13 changes: 13 additions & 0 deletions
13
PaperFold-ContainmentView/PaperFold-ContainmentView/LeftViewController.h
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// LeftViewController.h | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface LeftViewController : UITableViewController | ||
|
||
@end |
55 changes: 55 additions & 0 deletions
55
PaperFold-ContainmentView/PaperFold-ContainmentView/LeftViewController.m
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// LeftViewController.m | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import "LeftViewController.h" | ||
|
||
@interface LeftViewController () | ||
|
||
@end | ||
|
||
@implementation LeftViewController | ||
|
||
- (id)initWithStyle:(UITableViewStyle)style | ||
{ | ||
self = [super initWithStyle:style]; | ||
if (self) { | ||
// Custom initialization | ||
} | ||
return self; | ||
} | ||
|
||
|
||
#pragma mark - Table view data source | ||
|
||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
{ | ||
return 1; | ||
} | ||
|
||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
{ | ||
return 10; | ||
} | ||
|
||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
static NSString *CellIdentifier = @"Cell"; | ||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | ||
if (!cell) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; | ||
return cell; | ||
} | ||
|
||
#pragma mark - Table view delegate | ||
|
||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
UITableViewController *viewController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain]; | ||
[self.navigationController pushViewController:viewController animated:YES]; | ||
} | ||
|
||
@end |
38 changes: 38 additions & 0 deletions
38
PaperFold-ContainmentView/PaperFold-ContainmentView/PaperFold-ContainmentView-Info.plist
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?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> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
</dict> | ||
</plist> |
14 changes: 14 additions & 0 deletions
14
PaperFold-ContainmentView/PaperFold-ContainmentView/PaperFold-ContainmentView-Prefix.pch
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Prefix header for all source files of the 'PaperFold-ContainmentView' target in the 'PaperFold-ContainmentView' 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 |
13 changes: 13 additions & 0 deletions
13
PaperFold-ContainmentView/PaperFold-ContainmentView/RightViewController.h
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// RightViewController.h | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface RightViewController : UITableViewController | ||
|
||
@end |
64 changes: 64 additions & 0 deletions
64
PaperFold-ContainmentView/PaperFold-ContainmentView/RightViewController.m
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// RightViewController.m | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import "RightViewController.h" | ||
|
||
@interface RightViewController () | ||
|
||
@end | ||
|
||
@implementation RightViewController | ||
|
||
- (id)initWithStyle:(UITableViewStyle)style | ||
{ | ||
self = [super initWithStyle:style]; | ||
if (self) { | ||
// Custom initialization | ||
} | ||
return self; | ||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated | ||
{ | ||
NSLog(@"right view will appear"); | ||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated | ||
{ | ||
NSLog(@"right view did appear"); | ||
} | ||
|
||
#pragma mark - Table view data source | ||
|
||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
{ | ||
return 1; | ||
} | ||
|
||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
{ | ||
return 10; | ||
} | ||
|
||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
static NSString *CellIdentifier = @"Cell"; | ||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | ||
if (!cell) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; | ||
return cell; | ||
} | ||
|
||
#pragma mark - Table view delegate | ||
|
||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
UITableViewController *viewController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain]; | ||
[self.navigationController pushViewController:viewController animated:YES]; | ||
} | ||
|
||
@end |
2 changes: 2 additions & 0 deletions
2
PaperFold-ContainmentView/PaperFold-ContainmentView/en.lproj/InfoPlist.strings
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* Localized versions of Info.plist keys */ | ||
|
18 changes: 18 additions & 0 deletions
18
PaperFold-ContainmentView/PaperFold-ContainmentView/main.m
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// main.m | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. 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])); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
PaperFold/PaperFold/PaperFold/PaperFoldNavigationController.h
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// PaperFoldNavigationController.h | ||
// PaperFold-ContainmentView | ||
// | ||
// Created by honcheng on 10/8/12. | ||
// Copyright (c) 2012 honcheng. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "PaperFoldView.h" | ||
|
||
@interface PaperFoldNavigationController : UIViewController <PaperFoldViewDelegate> | ||
@property (nonatomic, strong) UIViewController *rootViewController, *leftViewController, *rightViewController; | ||
@property (nonatomic, strong) PaperFoldView *paperFoldView; | ||
- (id)initWithRootViewController:(UIViewController*)rootViewController; | ||
- (void)setLeftViewController:(UIViewController *)leftViewController width:(float)width; | ||
- (void)setRightViewController:(UIViewController*)rightViewController width:(float)width rightViewFoldCount:(int)rightViewFoldCount rightViewPullFactor:(float)rightViewPullFactor; | ||
@end |
Oops, something went wrong.