├── .gitignore ├── LICENSE.txt ├── README.md ├── RevealControllerExample ├── RevealControllerProject.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── RevealControllerProject │ ├── .DS_Store │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── CustomAnimationController.h │ ├── CustomAnimationController.m │ ├── Default-568h@2x.png │ ├── FrontViewController.h │ ├── FrontViewController.m │ ├── MapViewController.h │ ├── MapViewController.m │ ├── Project-Prefix.pch │ ├── RearViewController.h │ ├── RearViewController.m │ ├── RevealControllerProject-Info.plist │ ├── RightViewController.h │ ├── RightViewController.m │ ├── RightViewController.xib │ ├── en.lproj │ ├── FrontViewController.xib │ ├── InfoPlist.strings │ ├── MapViewController.xib │ └── RearViewController.xib │ ├── main.m │ ├── reveal-icon.png │ └── reveal-icon@2x.png ├── RevealControllerExample2 ├── RevealControllerProject2.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── RevealControllerProject2 │ ├── .DS_Store │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Default-568h@2x.png │ ├── FrontViewController.h │ ├── FrontViewController.m │ ├── MapViewController.h │ ├── MapViewController.m │ ├── Project-Prefix.pch │ ├── RearViewController.h │ ├── RearViewController.m │ ├── Resources │ ├── .DS_Store │ ├── 21-skull.png │ ├── 21-skull@2x.png │ ├── 24-gift.png │ ├── 24-gift@2x.png │ ├── 28-star.png │ ├── 28-star@2x.png │ ├── 29-heart.png │ ├── 29-heart@2x.png │ ├── 31-ipod.png │ ├── 31-ipod@2x.png │ ├── 38-airplane.png │ ├── 38-airplane@2x.png │ ├── bg_blocks.jpg │ ├── bg_flowers.jpg │ ├── bg_grass.jpg │ ├── reveal-icon.png │ └── reveal-icon@2x.png │ ├── RevealControllerProject-Info.plist │ ├── en.lproj │ ├── FrontViewController.xib │ ├── InfoPlist.strings │ ├── MapViewController.xib │ └── RearViewController.xib │ └── main.m ├── RevealControllerExample3 ├── RevealControllerProject3.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── RevealControllerProject3 │ ├── .DS_Store │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Default-568h@2x.png │ ├── FrontViewController.h │ ├── FrontViewController.m │ ├── FrontViewControllerImage.h │ ├── FrontViewControllerImage.m │ ├── FrontViewControllerImage.xib │ ├── FrontViewControllerLabel.h │ ├── FrontViewControllerLabel.m │ ├── FrontViewControllerLabel.xib │ ├── Project-Prefix.pch │ ├── RearMasterTableViewController.h │ ├── RearMasterTableViewController.m │ ├── RearMasterTableViewControllerv.xib │ ├── RearTableViewController.h │ ├── RearTableViewController.m │ ├── RearTableViewController.xib │ ├── Resources │ ├── .DS_Store │ ├── airplane.png │ ├── airplane@2x.png │ ├── bg_blocks.jpg │ ├── bg_flowers.jpg │ ├── bg_grass.jpg │ ├── gift.png │ ├── gift@2x.png │ ├── heart.png │ ├── heart@2x.png │ ├── ipod.png │ ├── ipod@2x.png │ ├── reveal-icon.png │ ├── reveal-icon@2x.png │ ├── skull.png │ ├── skull@2x.png │ ├── star.png │ └── star@2x.png │ ├── RevealControllerProject-Info.plist │ ├── en.lproj │ ├── .DS_Store │ ├── FrontViewController.xib │ └── InfoPlist.strings │ └── main.m ├── RevealControllerProject.png ├── RevealControllerProject2_a.png ├── RevealControllerProject3_a.png ├── RevealControllerProject3_b.png ├── RevealControllerProject3_c.png ├── RevealControllerStoryboardExample2 ├── RevealControllerStoryboardExample2.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── RevealControllerStoryboardExample2 │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── ColorViewController.h │ ├── ColorViewController.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── MapViewController.h │ ├── MapViewController.m │ ├── MenuViewController.h │ ├── MenuViewController.m │ ├── RevealControllerStoryboardExample2-Info.plist │ ├── RevealControllerStoryboardExample2-Prefix.pch │ ├── en.lproj │ ├── InfoPlist.strings │ ├── MainStoryboard-iPad.storyboard │ └── MainStoryboard.storyboard │ ├── main.m │ ├── reveal-icon.png │ └── reveal-icon@2x.png ├── SWRevealViewController.podspec └── SWRevealViewController ├── SWRevealViewController.h └── SWRevealViewController.m /.gitignore: -------------------------------------------------------------------------------- 1 | # From https://github.com/github/gitignore/blob/master/Objective-C.gitignore 2 | # 3 | 4 | # OS X 5 | .DS_Store 6 | 7 | # Xcode 8 | build/ 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata 18 | *.xccheckout 19 | profile 20 | *.moved-aside 21 | DerivedData 22 | *.hmap 23 | *.ipa 24 | 25 | # CocoaPods 26 | Pods 27 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Joan Lluch 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | Early code inspired on a similar class by Philip Kluz (Philip.Kluz@zuui.org) -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample/RevealControllerProject/.DS_Store -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Early code inspired on a similar class by Philip Kluz (Philip.Kluz@zuui.org) 24 | 25 | */ 26 | 27 | #import 28 | 29 | @class SWRevealViewController; 30 | 31 | @interface AppDelegate : UIResponder 32 | 33 | @property (strong, nonatomic) UIWindow *window; 34 | @property (strong, nonatomic) SWRevealViewController *viewController; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Early code inspired on a similar class by Philip Kluz (Philip.Kluz@zuui.org) 24 | 25 | */ 26 | 27 | 28 | #import "AppDelegate.h" 29 | 30 | #import "SWRevealViewController.h" 31 | #import "FrontViewController.h" 32 | #import "RearViewController.h" 33 | #import "RightViewController.h" 34 | #import "CustomAnimationController.h" 35 | 36 | @interface AppDelegate() 37 | @end 38 | 39 | @implementation AppDelegate 40 | 41 | @synthesize window = _window; 42 | @synthesize viewController = _viewController; 43 | 44 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 45 | { 46 | UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 47 | self.window = window; 48 | 49 | FrontViewController *frontViewController = [[FrontViewController alloc] init]; 50 | RearViewController *rearViewController = [[RearViewController alloc] init]; 51 | 52 | UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; 53 | UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController]; 54 | 55 | SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController]; 56 | revealController.delegate = self; 57 | 58 | 59 | RightViewController *rightViewController = rightViewController = [[RightViewController alloc] init]; 60 | rightViewController.view.backgroundColor = [UIColor greenColor]; 61 | 62 | revealController.rightViewController = rightViewController; 63 | 64 | //revealController.bounceBackOnOverdraw=NO; 65 | //revealController.stableDragOnOverdraw=YES; 66 | 67 | self.viewController = revealController; 68 | 69 | self.window.rootViewController = self.viewController; 70 | [self.window makeKeyAndVisible]; 71 | return YES; 72 | } 73 | 74 | #pragma mark - SWRevealViewDelegate 75 | 76 | - (id )revealController:(SWRevealViewController *)revealController animationControllerForOperation:(SWRevealControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC 77 | { 78 | if ( operation != SWRevealControllerOperationReplaceRightController ) 79 | return nil; 80 | 81 | if ( [toVC isKindOfClass:[RightViewController class]] ) 82 | { 83 | if ( [(RightViewController*)toVC wantsCustomAnimation] ) 84 | { 85 | id animationController = [[CustomAnimationController alloc] init]; 86 | return animationController; 87 | } 88 | } 89 | 90 | return nil; 91 | } 92 | 93 | 94 | #define LogDelegates 0 95 | 96 | #if LogDelegates 97 | - (NSString*)stringFromFrontViewPosition:(FrontViewPosition)position 98 | { 99 | NSString *str = nil; 100 | if ( position == FrontViewPositionLeftSideMostRemoved ) str = @"FrontViewPositionLeftSideMostRemoved"; 101 | if ( position == FrontViewPositionLeftSideMost) str = @"FrontViewPositionLeftSideMost"; 102 | if ( position == FrontViewPositionLeftSide) str = @"FrontViewPositionLeftSide"; 103 | if ( position == FrontViewPositionLeft ) str = @"FrontViewPositionLeft"; 104 | if ( position == FrontViewPositionRight ) str = @"FrontViewPositionRight"; 105 | if ( position == FrontViewPositionRightMost ) str = @"FrontViewPositionRightMost"; 106 | if ( position == FrontViewPositionRightMostRemoved ) str = @"FrontViewPositionRightMostRemoved"; 107 | return str; 108 | } 109 | 110 | - (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position 111 | { 112 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), [self stringFromFrontViewPosition:position]); 113 | } 114 | 115 | - (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position 116 | { 117 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), [self stringFromFrontViewPosition:position]); 118 | } 119 | 120 | - (void)revealController:(SWRevealViewController *)revealController animateToPosition:(FrontViewPosition)position 121 | { 122 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), [self stringFromFrontViewPosition:position]); 123 | } 124 | 125 | - (void)revealControllerPanGestureBegan:(SWRevealViewController *)revealController; 126 | { 127 | NSLog( @"%@", NSStringFromSelector(_cmd) ); 128 | } 129 | 130 | - (void)revealControllerPanGestureEnded:(SWRevealViewController *)revealController; 131 | { 132 | NSLog( @"%@", NSStringFromSelector(_cmd) ); 133 | } 134 | 135 | - (void)revealController:(SWRevealViewController *)revealController panGestureBeganFromLocation:(CGFloat)location progress:(CGFloat)progress 136 | { 137 | NSLog( @"%@: %f, %f", NSStringFromSelector(_cmd), location, progress); 138 | } 139 | 140 | - (void)revealController:(SWRevealViewController *)revealController panGestureMovedToLocation:(CGFloat)location progress:(CGFloat)progress 141 | { 142 | NSLog( @"%@: %f, %f", NSStringFromSelector(_cmd), location, progress); 143 | } 144 | 145 | - (void)revealController:(SWRevealViewController *)revealController panGestureEndedToLocation:(CGFloat)location progress:(CGFloat)progress 146 | { 147 | NSLog( @"%@: %f, %f", NSStringFromSelector(_cmd), location, progress); 148 | } 149 | 150 | - (void)revealController:(SWRevealViewController *)revealController willAddViewController:(UIViewController *)viewController forOperation:(SWRevealControllerOperation)operation animated:(BOOL)animated 151 | { 152 | NSLog( @"%@: %@, %d", NSStringFromSelector(_cmd), viewController, operation); 153 | } 154 | 155 | - (void)revealController:(SWRevealViewController *)revealController didAddViewController:(UIViewController *)viewController forOperation:(SWRevealControllerOperation)operation animated:(BOOL)animated 156 | { 157 | NSLog( @"%@: %@, %d", NSStringFromSelector(_cmd), viewController, operation); 158 | } 159 | 160 | #endif 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | @end -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/CustomAnimationController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import 26 | 27 | @interface CustomAnimationController : NSObject 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/CustomAnimationController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import "CustomAnimationController.h" 26 | 27 | 28 | #define TRANSITION_DURATION 0.5 29 | 30 | @implementation CustomAnimationController 31 | 32 | - (NSTimeInterval)transitionDuration:(id )transitionContext 33 | { 34 | return TRANSITION_DURATION; 35 | } 36 | 37 | 38 | - (void)animateTransition:(id )transitionContext 39 | { 40 | UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 41 | UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 42 | 43 | UIView *fromView = fromViewController.view; 44 | UIView *toView = toViewController.view; 45 | 46 | CGRect initialFromViewFrame = [transitionContext initialFrameForViewController:fromViewController]; 47 | CGRect finalFromViewFrame = initialFromViewFrame; 48 | finalFromViewFrame.origin.y -= initialFromViewFrame.size.height; 49 | 50 | CGRect finalToViewFrame = [transitionContext finalFrameForViewController:toViewController]; 51 | CGRect initialToViewFrame = finalToViewFrame; 52 | initialToViewFrame.origin.y += finalToViewFrame.size.height; 53 | 54 | fromView.frame = initialFromViewFrame; 55 | toView.frame = initialToViewFrame; 56 | 57 | [UIView animateWithDuration:TRANSITION_DURATION 58 | animations:^ { fromView.frame = finalFromViewFrame; toView.frame = finalToViewFrame;} 59 | completion:^(BOOL finished) { [transitionContext completeTransition:finished]; }]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample/RevealControllerProject/Default-568h@2x.png -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/FrontViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Original code: 24 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 25 | */ 26 | 27 | #import 28 | 29 | @interface FrontViewController : UIViewController 30 | 31 | @end -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/FrontViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Original code: 24 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 25 | */ 26 | 27 | #import "FrontViewController.h" 28 | #import "SWRevealViewController.h" 29 | 30 | @interface FrontViewController() 31 | 32 | // Private Methods: 33 | - (IBAction)pushExample:(id)sender; 34 | 35 | @end 36 | 37 | @implementation FrontViewController 38 | 39 | #pragma mark - View lifecycle 40 | 41 | 42 | - (void)viewDidLoad 43 | { 44 | [super viewDidLoad]; 45 | 46 | self.title = NSLocalizedString(@"Front View", nil); 47 | 48 | SWRevealViewController *revealController = [self revealViewController]; 49 | 50 | 51 | [revealController panGestureRecognizer]; 52 | [revealController tapGestureRecognizer]; 53 | 54 | UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] 55 | style:UIBarButtonItemStylePlain target:revealController action:@selector(revealToggle:)]; 56 | 57 | self.navigationItem.leftBarButtonItem = revealButtonItem; 58 | 59 | UIBarButtonItem *rightRevealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] 60 | style:UIBarButtonItemStylePlain target:revealController action:@selector(rightRevealToggle:)]; 61 | 62 | self.navigationItem.rightBarButtonItem = rightRevealButtonItem; 63 | } 64 | 65 | #pragma mark - Example Code 66 | 67 | - (IBAction)pushExample:(id)sender 68 | { 69 | UIViewController *stubController = [[UIViewController alloc] init]; 70 | stubController.view.backgroundColor = [UIColor whiteColor]; 71 | [self.navigationController pushViewController:stubController animated:YES]; 72 | } 73 | 74 | 75 | //- (void)viewWillAppear:(BOOL)animated 76 | //{ 77 | // [super viewWillAppear:animated]; 78 | // NSLog( @"%@: FRONT", NSStringFromSelector(_cmd)); 79 | //} 80 | // 81 | //- (void)viewWillDisappear:(BOOL)animated 82 | //{ 83 | // [super viewWillDisappear:animated]; 84 | // NSLog( @"%@: FRONT", NSStringFromSelector(_cmd)); 85 | //} 86 | // 87 | //- (void)viewDidAppear:(BOOL)animated 88 | //{ 89 | // [super viewDidAppear:animated]; 90 | // NSLog( @"%@: FRONT", NSStringFromSelector(_cmd)); 91 | //} 92 | // 93 | //- (void)viewDidDisappear:(BOOL)animated 94 | //{ 95 | // [super viewDidDisappear:animated]; 96 | // NSLog( @"%@: FRONT", NSStringFromSelector(_cmd)); 97 | //} 98 | 99 | @end -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/MapViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import 26 | 27 | @interface MapViewController : UIViewController 28 | 29 | @end -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/MapViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import "MapViewController.h" 26 | #import "SWRevealViewController.h" 27 | 28 | @implementation MapViewController 29 | 30 | #pragma mark - View lifecycle 31 | 32 | - (void)viewDidLoad 33 | { 34 | [super viewDidLoad]; 35 | 36 | self.title = NSLocalizedString(@"Map View", nil); 37 | 38 | SWRevealViewController *revealController = [self revealViewController]; 39 | 40 | //[self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer]; 41 | 42 | UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] 43 | style:UIBarButtonItemStylePlain target:revealController action:@selector(revealToggle:)]; 44 | 45 | self.navigationItem.leftBarButtonItem = revealButtonItem; 46 | 47 | UIBarButtonItem *rightRevealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] 48 | style:UIBarButtonItemStylePlain target:revealController action:@selector(rightRevealToggle:)]; 49 | 50 | self.navigationItem.rightBarButtonItem = rightRevealButtonItem; 51 | } 52 | 53 | 54 | //- (void)viewWillAppear:(BOOL)animated 55 | //{ 56 | // [super viewWillAppear:animated]; 57 | // NSLog( @"%@: MAP", NSStringFromSelector(_cmd)); 58 | //} 59 | // 60 | //- (void)viewWillDisappear:(BOOL)animated 61 | //{ 62 | // [super viewWillDisappear:animated]; 63 | // NSLog( @"%@: MAP", NSStringFromSelector(_cmd)); 64 | //} 65 | // 66 | //- (void)viewDidAppear:(BOOL)animated 67 | //{ 68 | // [super viewDidAppear:animated]; 69 | // NSLog( @"%@: MAP", NSStringFromSelector(_cmd)); 70 | //} 71 | // 72 | //- (void)viewDidDisappear:(BOOL)animated 73 | //{ 74 | // [super viewDidDisappear:animated]; 75 | // NSLog( @"%@: MAP", NSStringFromSelector(_cmd)); 76 | //} 77 | 78 | @end -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/Project-Prefix.pch: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #import 34 | 35 | #ifndef __IPHONE_4_0 36 | #warning "This project uses features only available in iOS SDK 4.0 and later." 37 | #endif 38 | 39 | #ifdef __OBJC__ 40 | #import 41 | #import 42 | #endif 43 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/RearViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Original code: 24 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 25 | */ 26 | 27 | #import 28 | 29 | @interface RearViewController : UIViewController 30 | 31 | @property (nonatomic, retain) IBOutlet UITableView *rearTableView; 32 | 33 | 34 | @end -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/RearViewController.m: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 4 | Copyright (c) 2013 Joan Lluch 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is furnished 11 | to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | 24 | Original code: 25 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 26 | 27 | */ 28 | 29 | #import "RearViewController.h" 30 | 31 | #import "SWRevealViewController.h" 32 | #import "FrontViewController.h" 33 | #import "MapViewController.h" 34 | 35 | @interface RearViewController() 36 | { 37 | NSInteger _presentedRow; 38 | } 39 | 40 | @end 41 | 42 | @implementation RearViewController 43 | 44 | @synthesize rearTableView = _rearTableView; 45 | 46 | 47 | #pragma mark - View lifecycle 48 | 49 | 50 | - (void)viewDidLoad 51 | { 52 | [super viewDidLoad]; 53 | 54 | self.title = NSLocalizedString(@"Rear View", nil); 55 | } 56 | 57 | 58 | #pragma marl - UITableView Data Source 59 | 60 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 61 | { 62 | return 4; 63 | } 64 | 65 | 66 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 67 | { 68 | static NSString *cellIdentifier = @"Cell"; 69 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 70 | NSInteger row = indexPath.row; 71 | 72 | if (nil == cell) 73 | { 74 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier]; 75 | } 76 | 77 | NSString *text = nil; 78 | if (row == 0) 79 | { 80 | text = @"Front View Controller"; 81 | } 82 | else if (row == 1) 83 | { 84 | text = @"Map View Controller"; 85 | } 86 | else if (row == 2) 87 | { 88 | text = @"Enter Presentation Mode"; 89 | } 90 | else if (row == 3) 91 | { 92 | text = @"Resign Presentation Mode"; 93 | } 94 | 95 | cell.textLabel.text = NSLocalizedString( text,nil ); 96 | 97 | return cell; 98 | } 99 | 100 | 101 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 102 | { 103 | // Grab a handle to the reveal controller, as if you'd do with a navigtion controller via self.navigationController. 104 | SWRevealViewController *revealController = self.revealViewController; 105 | 106 | // selecting row 107 | NSInteger row = indexPath.row; 108 | 109 | // if we are trying to push the same row or perform an operation that does not imply frontViewController replacement 110 | // we'll just set position and return 111 | 112 | if ( row == _presentedRow ) 113 | { 114 | [revealController setFrontViewPosition:FrontViewPositionLeft animated:YES]; 115 | return; 116 | } 117 | else if (row == 2) 118 | { 119 | [revealController setFrontViewPosition:FrontViewPositionRightMost animated:YES]; 120 | return; 121 | } 122 | else if (row == 3) 123 | { 124 | [revealController setFrontViewPosition:FrontViewPositionRight animated:YES]; 125 | return; 126 | } 127 | 128 | // otherwise we'll create a new frontViewController and push it with animation 129 | 130 | UIViewController *newFrontController = nil; 131 | 132 | if (row == 0) 133 | { 134 | newFrontController = [[FrontViewController alloc] init]; 135 | } 136 | 137 | else if (row == 1) 138 | { 139 | newFrontController = [[MapViewController alloc] init]; 140 | } 141 | 142 | UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:newFrontController]; 143 | [revealController pushFrontViewController:navigationController animated:YES]; 144 | 145 | _presentedRow = row; // <- store the presented row 146 | } 147 | 148 | 149 | 150 | //- (void)viewWillAppear:(BOOL)animated 151 | //{ 152 | // [super viewWillAppear:animated]; 153 | // NSLog( @"%@: REAR", NSStringFromSelector(_cmd)); 154 | //} 155 | // 156 | //- (void)viewWillDisappear:(BOOL)animated 157 | //{ 158 | // [super viewWillDisappear:animated]; 159 | // NSLog( @"%@: REAR", NSStringFromSelector(_cmd)); 160 | //} 161 | // 162 | //- (void)viewDidAppear:(BOOL)animated 163 | //{ 164 | // [super viewDidAppear:animated]; 165 | // NSLog( @"%@: REAR", NSStringFromSelector(_cmd)); 166 | //} 167 | // 168 | //- (void)viewDidDisappear:(BOOL)animated 169 | //{ 170 | // [super viewDidDisappear:animated]; 171 | // NSLog( @"%@: REAR", NSStringFromSelector(_cmd)); 172 | //} 173 | 174 | @end -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/RevealControllerProject-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | org.zuui.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | UIInterfaceOrientationPortraitUpsideDown 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/RightViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import 26 | 27 | @interface RightViewController : UIViewController 28 | 29 | @property (nonatomic) BOOL wantsCustomAnimation; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/RightViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import "RightViewController.h" 26 | #import "MapViewController.h" 27 | #import "SWRevealViewController.h" 28 | 29 | @interface RightViewController () 30 | // Private Methods: 31 | - (IBAction)replaceMe:(id)sender; 32 | - (IBAction)replaceMeCustom:(id)sender; 33 | - (IBAction)toggleFront:(id)sender; 34 | @end 35 | 36 | @implementation RightViewController 37 | 38 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 39 | { 40 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 41 | if (self) { 42 | // Custom initialization 43 | } 44 | return self; 45 | } 46 | 47 | - (void)viewDidLoad 48 | { 49 | [super viewDidLoad]; 50 | 51 | // Set a random -not too dark- background color. 52 | CGFloat r = 0.001f*(250+arc4random_uniform(750)); 53 | CGFloat g = 0.001f*(250+arc4random_uniform(750)); 54 | CGFloat b = 0.001f*(250+arc4random_uniform(750)); 55 | UIColor *color = [UIColor colorWithRed:r green:g blue:b alpha:1.0f]; 56 | self.view.backgroundColor = color; 57 | } 58 | 59 | - (void)didReceiveMemoryWarning 60 | { 61 | [super didReceiveMemoryWarning]; 62 | // Dispose of any resources that can be recreated. 63 | } 64 | 65 | #define TestStatusBarStyle 0 // <-- set this to 1 to test status bar style 66 | #if TestStatusBarStyle 67 | - (UIStatusBarStyle)preferredStatusBarStyle 68 | { 69 | return UIStatusBarStyleLightContent; 70 | } 71 | #endif 72 | 73 | #define TestStatusBarHidden 0 // <-- set this to 1 to test status bar hidden 74 | #if TestStatusBarHidden 75 | - (BOOL)prefersStatusBarHidden 76 | { 77 | return YES; 78 | } 79 | #endif 80 | 81 | - (IBAction)replaceMe:(id)sender 82 | { 83 | RightViewController *replacement = [[RightViewController alloc] init]; 84 | [self.revealViewController setRightViewController:replacement animated:YES]; 85 | } 86 | 87 | - (IBAction)replaceMeCustom:(id)sender 88 | { 89 | RightViewController *replacement = [[RightViewController alloc] init]; 90 | replacement.wantsCustomAnimation = YES; 91 | [self.revealViewController setRightViewController:replacement animated:YES]; 92 | } 93 | 94 | 95 | - (IBAction)toggleFront:(id)sender 96 | { 97 | MapViewController *mapViewController = [[MapViewController alloc] init]; 98 | UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:mapViewController]; 99 | 100 | [self.revealViewController pushFrontViewController:navigationController animated:YES]; 101 | } 102 | 103 | 104 | //- (void)dealloc 105 | //{ 106 | // NSLog(@"RightController dealloc"); 107 | //} 108 | // 109 | //- (void)viewWillAppear:(BOOL)animated 110 | //{ 111 | // [super viewWillAppear:animated]; 112 | // NSLog( @"%@: RIGHT %@", NSStringFromSelector(_cmd), self); 113 | //} 114 | // 115 | //- (void)viewWillDisappear:(BOOL)animated 116 | //{ 117 | // [super viewWillDisappear:animated]; 118 | // NSLog( @"%@: RIGHT %@", NSStringFromSelector(_cmd), self); 119 | //} 120 | // 121 | //- (void)viewDidAppear:(BOOL)animated 122 | //{ 123 | // [super viewDidAppear:animated]; 124 | // NSLog( @"%@: RIGHT %@", NSStringFromSelector(_cmd), self); 125 | //} 126 | // 127 | //- (void)viewDidDisappear:(BOOL)animated 128 | //{ 129 | // [super viewDidDisappear:animated]; 130 | // NSLog( @"%@: RIGHT %@", NSStringFromSelector(_cmd), self); 131 | //} 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/RightViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 29 | 40 | 49 | 60 | 69 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/en.lproj/FrontViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 28 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/en.lproj/MapViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12E55 6 | 4457.9 7 | 1187.39 8 | 626.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 3682.9 12 | 13 | 14 | IBMKMapView 15 | IBProxyObject 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 1298 37 | 38 | 39 | 40 | 1298 41 | 42 | {320, 460} 43 | 44 | 45 | YES 46 | YES 47 | IBCocoaTouchFramework 48 | 49 | 50 | 51 | {{0, 20}, {320, 460}} 52 | 53 | 54 | 55 | 3 56 | MQA 57 | 58 | 2 59 | 60 | 61 | 62 | IBCocoaTouchFramework 63 | 64 | 65 | 66 | NO 67 | 68 | 69 | 70 | view 71 | 72 | 73 | 74 | 4 75 | 76 | 77 | 78 | 79 | 80 | 0 81 | 82 | 83 | 84 | 85 | 86 | -1 87 | 88 | 89 | File's Owner 90 | 91 | 92 | -2 93 | 94 | 95 | 96 | 97 | 1 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 3 106 | 107 | 108 | 109 | 110 | 111 | 112 | MapViewController 113 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 114 | 115 | UIResponder 116 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 117 | 118 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 119 | 120 | 121 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | MapViewController 134 | UIViewController 135 | 136 | IBProjectSource 137 | ./Classes/MapViewController.h 138 | 139 | 140 | 141 | 142 | 0 143 | IBCocoaTouchFramework 144 | 145 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 146 | 147 | 148 | 149 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 150 | 151 | 152 | YES 153 | 3 154 | 3682.9 155 | 156 | 157 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/en.lproj/RearViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12E55 6 | 4457.9 7 | 1187.39 8 | 626.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 3682.9 12 | 13 | 14 | IBProxyObject 15 | IBUITableView 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 1298 37 | 38 | 39 | 40 | 1298 41 | 42 | {320, 460} 43 | 44 | 45 | 46 | 3 47 | MQA 48 | 49 | YES 50 | IBCocoaTouchFramework 51 | YES 52 | 1 53 | 0 54 | YES 55 | 44 56 | 22 57 | 22 58 | 59 | 60 | 61 | {320, 460} 62 | 63 | 64 | 65 | 3 66 | MC4xOTc4MjE2MjQxAA 67 | 68 | IBCocoaTouchFramework 69 | 70 | 71 | 72 | NO 73 | 74 | 75 | 76 | rearTableView 77 | 78 | 79 | 80 | 24 81 | 82 | 83 | 84 | view 85 | 86 | 87 | 88 | 21 89 | 90 | 91 | 92 | dataSource 93 | 94 | 95 | 96 | 22 97 | 98 | 99 | 100 | delegate 101 | 102 | 103 | 104 | 23 105 | 106 | 107 | 108 | 109 | 110 | 0 111 | 112 | 113 | 114 | 115 | 116 | -1 117 | 118 | 119 | File's Owner 120 | 121 | 122 | -2 123 | 124 | 125 | 126 | 127 | 1 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 20 136 | 137 | 138 | 139 | 140 | 141 | 142 | RearViewController 143 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 144 | 145 | UIResponder 146 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 147 | 148 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 149 | 150 | 151 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | RearViewController 164 | UIViewController 165 | 166 | rearTableView 167 | UITableView 168 | 169 | 170 | rearTableView 171 | 172 | rearTableView 173 | UITableView 174 | 175 | 176 | 177 | IBProjectSource 178 | ./Classes/RearViewController.h 179 | 180 | 181 | 182 | 183 | 0 184 | IBCocoaTouchFramework 185 | 186 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 187 | 188 | 189 | 190 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 191 | 192 | 193 | YES 194 | 3 195 | 3682.9 196 | 197 | 198 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #import 34 | #import "AppDelegate.h" 35 | 36 | int main(int argc, char *argv[]) 37 | { 38 | @autoreleasepool 39 | { 40 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/reveal-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample/RevealControllerProject/reveal-icon.png -------------------------------------------------------------------------------- /RevealControllerExample/RevealControllerProject/reveal-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample/RevealControllerProject/reveal-icon@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/.DS_Store -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import 26 | 27 | @class SWRevealViewController; 28 | 29 | @interface AppDelegate : UIResponder 30 | 31 | @property (strong, nonatomic) UIWindow *window; 32 | @property (strong, nonatomic) SWRevealViewController *viewController; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import "AppDelegate.h" 26 | 27 | #import "SWRevealViewController.h" 28 | #import "FrontViewController.h" 29 | #import "RearViewController.h" 30 | 31 | @interface AppDelegate() 32 | @end 33 | 34 | @implementation AppDelegate 35 | 36 | @synthesize window = _window; 37 | @synthesize viewController = _viewController; 38 | 39 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 40 | { 41 | UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 42 | self.window = window; 43 | 44 | FrontViewController *frontViewController = [[FrontViewController alloc] init]; 45 | RearViewController *rearViewController = [[RearViewController alloc] init]; 46 | 47 | UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; 48 | UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController]; 49 | 50 | SWRevealViewController *mainRevealController = [[SWRevealViewController alloc] 51 | initWithRearViewController:rearNavigationController frontViewController:frontNavigationController]; 52 | 53 | mainRevealController.delegate = self; 54 | 55 | self.viewController = mainRevealController; 56 | 57 | self.window.rootViewController = self.viewController; 58 | [self.window makeKeyAndVisible]; 59 | return YES; 60 | } 61 | 62 | 63 | - (NSString*)stringFromFrontViewPosition:(FrontViewPosition)position 64 | { 65 | NSString *str = nil; 66 | if ( position == FrontViewPositionLeft ) str = @"FrontViewPositionLeft"; 67 | if ( position == FrontViewPositionRight ) str = @"FrontViewPositionRight"; 68 | if ( position == FrontViewPositionRightMost ) str = @"FrontViewPositionRightMost"; 69 | if ( position == FrontViewPositionRightMostRemoved ) str = @"FrontViewPositionRightMostRemoved"; 70 | return str; 71 | } 72 | 73 | 74 | - (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position 75 | { 76 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), [self stringFromFrontViewPosition:position]); 77 | } 78 | 79 | - (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position 80 | { 81 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), [self stringFromFrontViewPosition:position]); 82 | } 83 | 84 | - (void)revealController:(SWRevealViewController *)revealController willRevealRearViewController:(UIViewController *)rearViewController 85 | { 86 | NSLog( @"%@", NSStringFromSelector(_cmd)); 87 | } 88 | 89 | - (void)revealController:(SWRevealViewController *)revealController didRevealRearViewController:(UIViewController *)rearViewController 90 | { 91 | NSLog( @"%@", NSStringFromSelector(_cmd)); 92 | } 93 | 94 | - (void)revealController:(SWRevealViewController *)revealController willHideRearViewController:(UIViewController *)rearViewController 95 | { 96 | NSLog( @"%@", NSStringFromSelector(_cmd)); 97 | } 98 | 99 | - (void)revealController:(SWRevealViewController *)revealController didHideRearViewController:(UIViewController *)rearViewController 100 | { 101 | NSLog( @"%@", NSStringFromSelector(_cmd)); 102 | } 103 | 104 | - (void)revealController:(SWRevealViewController *)revealController willShowFrontViewController:(UIViewController *)rearViewController 105 | { 106 | NSLog( @"%@", NSStringFromSelector(_cmd)); 107 | } 108 | 109 | - (void)revealController:(SWRevealViewController *)revealController didShowFrontViewController:(UIViewController *)rearViewController 110 | { 111 | NSLog( @"%@", NSStringFromSelector(_cmd)); 112 | } 113 | 114 | - (void)revealController:(SWRevealViewController *)revealController willHideFrontViewController:(UIViewController *)rearViewController 115 | { 116 | NSLog( @"%@", NSStringFromSelector(_cmd)); 117 | } 118 | 119 | - (void)revealController:(SWRevealViewController *)revealController didHideFrontViewController:(UIViewController *)rearViewController 120 | 121 | { 122 | NSLog( @"%@", NSStringFromSelector(_cmd)); 123 | } 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | @end -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Default-568h@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/FrontViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Original code: 24 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 25 | */ 26 | 27 | #import 28 | 29 | @interface FrontViewController : UIViewController 30 | 31 | @end -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/FrontViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Original code: 24 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 25 | */ 26 | 27 | #import "FrontViewController.h" 28 | #import "SWRevealViewController.h" 29 | 30 | @interface FrontViewController() 31 | 32 | // Private Methods: 33 | - (IBAction)pushExample:(id)sender; 34 | 35 | @end 36 | 37 | @implementation FrontViewController 38 | 39 | #pragma mark - View lifecycle 40 | 41 | 42 | - (void)viewDidLoad 43 | { 44 | [super viewDidLoad]; 45 | 46 | self.title = NSLocalizedString(@"Front View", nil); 47 | 48 | SWRevealViewController *revealController = [self revealViewController]; 49 | 50 | [self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer]; 51 | 52 | UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] 53 | style:UIBarButtonItemStyleBordered target:revealController action:@selector(revealToggle:)]; 54 | 55 | self.navigationItem.leftBarButtonItem = revealButtonItem; 56 | } 57 | 58 | 59 | #pragma mark - Example Code 60 | 61 | - (IBAction)pushExample:(id)sender 62 | { 63 | UIViewController *stubController = [[UIViewController alloc] init]; 64 | stubController.view.backgroundColor = [UIColor whiteColor]; 65 | [self.navigationController pushViewController:stubController animated:YES]; 66 | } 67 | 68 | @end -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/MapViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Original code: 24 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 25 | */ 26 | 27 | #import 28 | 29 | @interface MapViewController : UIViewController 30 | 31 | @end -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/MapViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Original code: 24 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 25 | */ 26 | 27 | #import "MapViewController.h" 28 | #import "SWRevealViewController.h" 29 | 30 | @implementation MapViewController 31 | 32 | #pragma mark - View lifecycle 33 | 34 | - (void)viewDidLoad 35 | { 36 | [super viewDidLoad]; 37 | 38 | self.title = NSLocalizedString(@"Map View", nil); 39 | 40 | SWRevealViewController *revealController = [self revealViewController]; 41 | 42 | [self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer]; 43 | 44 | UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] 45 | style:UIBarButtonItemStyleBordered target:revealController action:@selector(revealToggle:)]; 46 | 47 | self.navigationItem.leftBarButtonItem = revealButtonItem; 48 | } 49 | 50 | 51 | @end -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Project-Prefix.pch: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #import 34 | 35 | #ifndef __IPHONE_4_0 36 | #warning "This project uses features only available in iOS SDK 4.0 and later." 37 | #endif 38 | 39 | #ifdef __OBJC__ 40 | #import 41 | #import 42 | #endif 43 | -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/RearViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import 26 | 27 | @interface RearViewController : UIViewController 28 | 29 | @property (nonatomic, retain) IBOutlet UITableView *rearTableView; 30 | //@property (nonatomic, retain) IBOutlet UIToolbar *rearToolBar; 31 | 32 | 33 | @end -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/RearViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2013 Joan Lluch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | */ 24 | 25 | #import "RearViewController.h" 26 | 27 | #import "SWRevealViewController.h" 28 | #import "FrontViewController.h" 29 | #import "MapViewController.h" 30 | 31 | @interface RearViewController() 32 | { 33 | NSInteger _presentedRow; 34 | } 35 | 36 | @end 37 | 38 | @implementation RearViewController 39 | 40 | @synthesize rearTableView = _rearTableView; 41 | 42 | /* 43 | * The following lines are crucial to understanding how the SWRevealViewController works. 44 | * 45 | * In this example, we show how a SWRevealViewController can be contained in another instance 46 | * of the same class. We have three scenarios of hierarchies as follows 47 | * 48 | * In the first scenario a FrontViewController is contained inside of a UINavigationController. 49 | * And the UINavigationController is contained inside of a SWRevealViewController. Thus the 50 | * following hierarchy is created: 51 | * 52 | * - SWRevealViewController is parent of: 53 | * - 1 UINavigationController is parent of: 54 | * - - 1.1 RearViewController 55 | * - 2 UINavigationController is parent of: 56 | * - - 2.1 FrontViewController 57 | * 58 | * In the second scenario a MapViewController is contained inside of a UINavigationController. 59 | * And the UINavigationController is contained inside of a SWRevealViewController. Thus the 60 | * following hierarchy is created: 61 | * 62 | * - SWRevealViewController is parent of: 63 | * - 1 UINavigationController is parent of: 64 | * - - 1.1 RearViewController 65 | * - 2 UINavigationController is parent of: 66 | * - - 1.2 MapViewController 67 | * 68 | * In the third scenario a SWRevealViewController is contained directly inside of another. 69 | * SWRevealController. Thus the following hierarchy is created: 70 | * 71 | * - SWRevealViewController is parent of: 72 | * - 1 UINavigationController is parent of: 73 | * - - 1.1 RearViewController 74 | * - 2 SWRevealViewController 75 | * - - ... 76 | * 77 | * The second SWRevealViewController on the third scenario can in turn contain anything. 78 | * On this example it may recursively contain any of the above, including again the third one 79 | */ 80 | 81 | - (void)viewDidLoad 82 | { 83 | [super viewDidLoad]; 84 | 85 | // We determine whether we have a grand parent SWRevealViewController, this means we are at least one level behind the hierarchy 86 | SWRevealViewController *parentRevealController = self.revealViewController; 87 | SWRevealViewController *grandParentRevealController = parentRevealController.revealViewController; 88 | 89 | UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] 90 | style:UIBarButtonItemStyleBordered target:grandParentRevealController action:@selector(revealToggle:)]; 91 | 92 | // if we have a reveal controller as a grand parent, this means we are are being added as a 93 | // child of a detail (child) reveal controller, so we add a gesture recognizer provided by our grand parent to our 94 | // navigation bar as well as a "reveal" button, we also set 95 | if ( grandParentRevealController ) 96 | { 97 | // to present a title, we count the number of ancestor reveal controllers we have, this is of course 98 | // only a hack for demonstration purposes, on a real project you would have a model telling this. 99 | NSInteger level=0; 100 | UIViewController *controller = grandParentRevealController; 101 | while( nil != (controller = [controller revealViewController]) ) 102 | level++; 103 | 104 | NSString *title = [NSString stringWithFormat:@"Detail Level %d", level]; 105 | 106 | [self.navigationController.navigationBar addGestureRecognizer:grandParentRevealController.panGestureRecognizer]; 107 | self.navigationItem.leftBarButtonItem = revealButtonItem; 108 | self.navigationItem.title = title; 109 | } 110 | 111 | // otherwise, we are in the top reveal controller, so we just add a title 112 | else 113 | { 114 | self.navigationItem.title = @"Master"; 115 | } 116 | } 117 | 118 | - (void)viewWillAppear:(BOOL)animated 119 | { 120 | [super viewWillAppear:animated]; 121 | 122 | SWRevealViewController *grandParentRevealController = self.revealViewController.revealViewController; 123 | grandParentRevealController.bounceBackOnOverdraw = NO; 124 | } 125 | 126 | - (void)viewWillDisappear:(BOOL)animated 127 | { 128 | [super viewWillDisappear:animated]; 129 | 130 | SWRevealViewController *grandParentRevealController = self.revealViewController.revealViewController; 131 | grandParentRevealController.bounceBackOnOverdraw = YES; 132 | } 133 | 134 | 135 | #pragma marl - UITableView Data Source 136 | 137 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 138 | { 139 | return 5; 140 | } 141 | 142 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 143 | { 144 | static NSString *cellIdentifier = @"Cell"; 145 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 146 | NSInteger row = indexPath.row; 147 | 148 | if (nil == cell) 149 | { 150 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier]; 151 | } 152 | 153 | NSString *text = nil; 154 | if (row == 0) 155 | { 156 | text = @"Front View Controller"; 157 | } 158 | else if (row == 1) 159 | { 160 | text = @"Map View Controller"; 161 | } 162 | else if (row == 2) 163 | { 164 | text = @"Enter Presentation Mode"; 165 | } 166 | else if (row == 3) 167 | { 168 | text = @"Resign Presentation Mode"; 169 | } 170 | else if (row == 4) 171 | { 172 | text = @"A RevealViewController !!"; 173 | } 174 | 175 | cell.textLabel.text = NSLocalizedString( text, nil ); 176 | 177 | return cell; 178 | } 179 | 180 | 181 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 182 | { 183 | // Grab a handle to the reveal controller, as if you'd do with a navigtion controller via self.navigationController. 184 | SWRevealViewController *revealController = self.revealViewController; 185 | 186 | // selecting row 187 | NSInteger row = indexPath.row; 188 | 189 | // if we are trying to push the same row or perform an operation that does not imply frontViewController replacement 190 | // we'll just set position and return 191 | 192 | if ( row == _presentedRow ) 193 | { 194 | [revealController setFrontViewPosition:FrontViewPositionLeft animated:YES]; 195 | return; 196 | } 197 | else if (row == 2) 198 | { 199 | [revealController setFrontViewPosition:FrontViewPositionRightMost animated:YES]; 200 | return; 201 | } 202 | else if (row == 3) 203 | { 204 | [revealController setFrontViewPosition:FrontViewPositionRight animated:YES]; 205 | return; 206 | } 207 | 208 | // otherwise we'll create a new frontViewController and push it with animation 209 | 210 | UIViewController *newFrontController = nil; 211 | 212 | if (row == 0) 213 | { 214 | FrontViewController *frontViewController = [[FrontViewController alloc] init]; 215 | newFrontController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; 216 | } 217 | 218 | else if (row == 1) 219 | { 220 | MapViewController *mapViewController = [[MapViewController alloc] init]; 221 | newFrontController = [[UINavigationController alloc] initWithRootViewController:mapViewController]; 222 | } 223 | 224 | else if ( row == 4 ) 225 | { 226 | FrontViewController *frontViewController = [[FrontViewController alloc] init]; 227 | UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; 228 | 229 | RearViewController *rearViewController = [[RearViewController alloc] init]; 230 | UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController]; 231 | 232 | SWRevealViewController *childRevealController = [[SWRevealViewController alloc] 233 | initWithRearViewController:rearNavigationController frontViewController:frontNavigationController]; 234 | 235 | childRevealController.rearViewRevealDisplacement = 0.0f; 236 | [childRevealController setFrontViewPosition:FrontViewPositionRight animated:NO]; 237 | 238 | newFrontController = childRevealController; 239 | } 240 | 241 | [revealController pushFrontViewController:newFrontController animated:YES]; 242 | 243 | _presentedRow = row; // <- store the presented row 244 | } 245 | 246 | 247 | 248 | @end -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/.DS_Store -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/21-skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/21-skull.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/21-skull@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/21-skull@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/24-gift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/24-gift.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/24-gift@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/24-gift@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/28-star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/28-star.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/28-star@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/28-star@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/29-heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/29-heart.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/29-heart@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/29-heart@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/31-ipod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/31-ipod.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/31-ipod@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/31-ipod@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/38-airplane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/38-airplane.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/38-airplane@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/38-airplane@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/bg_blocks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/bg_blocks.jpg -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/bg_flowers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/bg_flowers.jpg -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/bg_grass.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/bg_grass.jpg -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/reveal-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/reveal-icon.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/Resources/reveal-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample2/RevealControllerProject2/Resources/reveal-icon@2x.png -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/RevealControllerProject-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | org.zuui.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | UIInterfaceOrientationPortraitUpsideDown 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/en.lproj/FrontViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12E55 6 | 4457.9 7 | 1187.39 8 | 626.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 3682.9 12 | 13 | 14 | IBProxyObject 15 | IBUIButton 16 | IBUILabel 17 | IBUIView 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 1298 38 | 39 | 40 | 41 | 1314 42 | 43 | {{20, 101}, {280, 37}} 44 | 45 | NO 46 | IBCocoaTouchFramework 47 | 0 48 | 0 49 | 1 50 | Push! 51 | 52 | 3 53 | MQA 54 | 55 | 56 | 1 57 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 58 | 59 | 60 | 3 61 | MC41AA 62 | 63 | 64 | 2 65 | 15 66 | 67 | 68 | HelveticaNeue-Bold 69 | 15 70 | 16 71 | 72 | 73 | 74 | 75 | 1314 76 | 77 | {{17, 152}, {286, 88}} 78 | 79 | NO 80 | YES 81 | 7 82 | NO 83 | IBCocoaTouchFramework 84 | Note: You may always reveal the rear view by panning your finger across the NavigationBar. 85 | 86 | 3 87 | MC4zMTE3MDE2NDIzAA 88 | 89 | 90 | 91 | {0, 1} 92 | 1 93 | 10 94 | 5 95 | 1 96 | 97 | 1 98 | 17 99 | 100 | 101 | HelveticaNeue 102 | 17 103 | 16 104 | 105 | 286 106 | 107 | 108 | 109 | {{0, 20}, {320, 480}} 110 | 111 | 1 112 | MC44MjE5MDkyMTUzIDAuODYxMTk5ODE3NSAwLjkwNzc2MTE3NwA 113 | 114 | 115 | IBCocoaTouchFramework 116 | 117 | 118 | 119 | NO 120 | 121 | 122 | 123 | view 124 | 125 | 126 | 127 | 57 128 | 129 | 130 | 131 | pushExample: 132 | 133 | 134 | 7 135 | 136 | 59 137 | 138 | 139 | 140 | 141 | 142 | 0 143 | 144 | 145 | 146 | 147 | 148 | -1 149 | 150 | 151 | File's Owner 152 | 153 | 154 | -2 155 | 156 | 157 | 158 | 159 | 1 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 58 169 | 170 | 171 | 172 | 173 | 60 174 | 175 | 176 | 177 | 178 | 179 | 180 | FrontViewController 181 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 182 | 183 | UIResponder 184 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 185 | 186 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 187 | 188 | 189 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 190 | 191 | 192 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 0 203 | IBCocoaTouchFramework 204 | 205 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 206 | 207 | 208 | 209 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 210 | 211 | 212 | YES 213 | 3 214 | 3682.9 215 | 216 | 217 | -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/en.lproj/MapViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12E55 6 | 4457.9 7 | 1187.39 8 | 626.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 3682.9 12 | 13 | 14 | IBMKMapView 15 | IBProxyObject 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 274 41 | {320, 480} 42 | 43 | 44 | _NS:800 45 | YES 46 | YES 47 | IBCocoaTouchFramework 48 | 49 | 50 | {{0, 20}, {320, 460}} 51 | 52 | 53 | 54 | 55 | 3 56 | MQA 57 | 58 | 2 59 | 60 | 61 | 62 | IBCocoaTouchFramework 63 | 64 | 65 | 66 | NO 67 | 68 | 69 | 70 | view 71 | 72 | 73 | 74 | 4 75 | 76 | 77 | 78 | 79 | 80 | 0 81 | 82 | 83 | 84 | 85 | 86 | 1 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -1 95 | 96 | 97 | File's Owner 98 | 99 | 100 | -2 101 | 102 | 103 | 104 | 105 | 3 106 | 107 | 108 | 109 | 110 | 111 | 112 | MapViewController 113 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 114 | UIResponder 115 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 116 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 117 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | MapViewController 128 | UIViewController 129 | 130 | IBProjectSource 131 | ./Classes/MapViewController.h 132 | 133 | 134 | 135 | 136 | 0 137 | IBCocoaTouchFramework 138 | 139 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 140 | 141 | 142 | 143 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 144 | 145 | 146 | YES 147 | 3 148 | 3682.9 149 | 150 | 151 | -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/en.lproj/RearViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12E55 6 | 4457.9 7 | 1187.39 8 | 626.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 3682.9 12 | 13 | 14 | IBProxyObject 15 | IBUITableView 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 1300 37 | 38 | 39 | 40 | 1298 41 | 42 | {320, 460} 43 | 44 | 45 | 3 46 | MQA 47 | 48 | YES 49 | IBCocoaTouchFramework 50 | YES 51 | 1 52 | 0 53 | YES 54 | 44 55 | 22 56 | 22 57 | 58 | 59 | 60 | {320, 460} 61 | 62 | 3 63 | MC4xOTc4MjE2MjQxAA 64 | 65 | IBCocoaTouchFramework 66 | 67 | 68 | 69 | NO 70 | 71 | 72 | 73 | rearTableView 74 | 75 | 76 | 77 | 24 78 | 79 | 80 | 81 | view 82 | 83 | 84 | 85 | 21 86 | 87 | 88 | 89 | dataSource 90 | 91 | 92 | 93 | 22 94 | 95 | 96 | 97 | delegate 98 | 99 | 100 | 101 | 23 102 | 103 | 104 | 105 | 106 | 107 | 0 108 | 109 | 110 | 111 | 112 | 113 | -1 114 | 115 | 116 | File's Owner 117 | 118 | 119 | -2 120 | 121 | 122 | 123 | 124 | 1 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 20 133 | 134 | 135 | 136 | 137 | 138 | 139 | RearViewController 140 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 141 | 142 | UIResponder 143 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 144 | 145 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 146 | 147 | 148 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 0 159 | IBCocoaTouchFramework 160 | 161 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 162 | 163 | 164 | 165 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 166 | 167 | 168 | YES 169 | 3 170 | 3682.9 171 | 172 | 173 | -------------------------------------------------------------------------------- /RevealControllerExample2/RevealControllerProject2/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #import 34 | #import "AppDelegate.h" 35 | 36 | int main(int argc, char *argv[]) 37 | { 38 | @autoreleasepool 39 | { 40 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/.DS_Store -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @class SWRevealViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | //@property (strong, nonatomic) SWRevealViewController *viewController; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "SWRevealViewController.h" 12 | #import "FrontViewControllerImage.h" 13 | #import "RearMasterTableViewController.h" 14 | 15 | @interface AppDelegate() 16 | @end 17 | 18 | @implementation AppDelegate 19 | 20 | @synthesize window = _window; 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 23 | { 24 | UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 25 | self.window = window; 26 | 27 | RearMasterTableViewController *rearViewController = [[RearMasterTableViewController alloc] init]; 28 | FrontViewControllerImage *frontViewController = [[FrontViewControllerImage alloc] init]; 29 | 30 | SWRevealViewController *mainRevealController = 31 | [[SWRevealViewController alloc] initWithRearViewController:rearViewController frontViewController:frontViewController]; 32 | 33 | mainRevealController.rearViewRevealWidth = 60; 34 | mainRevealController.rearViewRevealOverdraw = 120; 35 | mainRevealController.bounceBackOnOverdraw = NO; 36 | mainRevealController.stableDragOnOverdraw = YES; 37 | [mainRevealController setFrontViewPosition:FrontViewPositionRight]; 38 | 39 | mainRevealController.delegate = self; 40 | 41 | self.window.rootViewController = mainRevealController; 42 | [self.window makeKeyAndVisible]; 43 | return YES; 44 | } 45 | 46 | 47 | - (NSString*)stringFromFrontViewPosition:(FrontViewPosition)position 48 | { 49 | NSString *str = nil; 50 | if ( position == FrontViewPositionLeft ) str = @"FrontViewPositionLeft"; 51 | if ( position == FrontViewPositionRight ) str = @"FrontViewPositionRight"; 52 | if ( position == FrontViewPositionRightMost ) str = @"FrontViewPositionRightMost"; 53 | if ( position == FrontViewPositionRightMostRemoved ) str = @"FrontViewPositionRightMostRemoved"; 54 | return str; 55 | } 56 | 57 | 58 | - (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position 59 | { 60 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), [self stringFromFrontViewPosition:position]); 61 | } 62 | 63 | - (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position 64 | { 65 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), [self stringFromFrontViewPosition:position]); 66 | } 67 | 68 | - (void)revealController:(SWRevealViewController *)revealController willRevealRearViewController:(UIViewController *)viewController 69 | { 70 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), viewController); 71 | } 72 | 73 | - (void)revealController:(SWRevealViewController *)revealController didRevealRearViewController:(UIViewController *)viewController 74 | { 75 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), viewController); 76 | } 77 | 78 | - (void)revealController:(SWRevealViewController *)revealController willHideRearViewController:(UIViewController *)viewController 79 | { 80 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), viewController); 81 | } 82 | 83 | - (void)revealController:(SWRevealViewController *)revealController didHideRearViewController:(UIViewController *)viewController 84 | { 85 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), viewController); 86 | } 87 | 88 | - (void)revealController:(SWRevealViewController *)revealController willShowFrontViewController:(UIViewController *)viewController 89 | { 90 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), viewController); 91 | } 92 | 93 | - (void)revealController:(SWRevealViewController *)revealController didShowFrontViewController:(UIViewController *)viewController 94 | { 95 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), viewController); 96 | } 97 | 98 | - (void)revealController:(SWRevealViewController *)revealController willHideFrontViewController:(UIViewController *)viewController 99 | { 100 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), viewController); 101 | } 102 | 103 | - (void)revealController:(SWRevealViewController *)revealController didHideFrontViewController:(UIViewController *)viewController 104 | { 105 | NSLog( @"%@: %@", NSStringFromSelector(_cmd), viewController); 106 | } 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | @end -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Default-568h@2x.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/FrontViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #import 34 | 35 | @interface FrontViewController : UIViewController 36 | 37 | @end -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/FrontViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #import "FrontViewController.h" 34 | #import "SWRevealViewController.h" 35 | 36 | @interface FrontViewController() 37 | 38 | // Private Methods: 39 | - (IBAction)pushExample:(id)sender; 40 | 41 | @end 42 | 43 | @implementation FrontViewController 44 | 45 | #pragma mark - View lifecycle 46 | 47 | 48 | - (void)viewDidLoad 49 | { 50 | [super viewDidLoad]; 51 | 52 | self.title = NSLocalizedString(@"Front View", nil); 53 | 54 | SWRevealViewController *revealController = [self revealViewController]; 55 | 56 | [self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer]; 57 | 58 | UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] 59 | style:UIBarButtonItemStyleBordered target:revealController action:@selector(revealToggle:)]; 60 | 61 | self.navigationItem.leftBarButtonItem = revealButtonItem; 62 | } 63 | 64 | 65 | #pragma mark - Example Code 66 | 67 | - (IBAction)pushExample:(id)sender 68 | { 69 | UIViewController *stubController = [[UIViewController alloc] init]; 70 | stubController.view.backgroundColor = [UIColor whiteColor]; 71 | [self.navigationController pushViewController:stubController animated:YES]; 72 | } 73 | 74 | @end -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/FrontViewControllerImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // FrontViewControllerBlocksViewController.h 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface FrontViewControllerImage : UIViewController 12 | 13 | @property (nonatomic) IBOutlet UIImageView *imageView; 14 | @property (nonatomic) IBOutlet UIButton *button; 15 | 16 | @property (nonatomic) UIImage *image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/FrontViewControllerImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // FrontViewControllerBlocksViewController.m 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import "FrontViewControllerImage.h" 10 | #import "SWRevealViewController.h" 11 | 12 | @implementation FrontViewControllerImage 13 | 14 | 15 | - (void)viewDidLoad 16 | { 17 | [super viewDidLoad]; 18 | 19 | _imageView.image = _image; 20 | 21 | SWRevealViewController *revealController = self.revealViewController; 22 | 23 | [self.view addGestureRecognizer:revealController.panGestureRecognizer]; 24 | [_button addTarget:revealController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchUpInside]; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/FrontViewControllerImage.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/FrontViewControllerLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // FrontViewControllerBlocksViewController.h 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface FrontViewControllerLabel : UIViewController 12 | 13 | @property (nonatomic) IBOutlet UILabel *label; 14 | @property (nonatomic) IBOutlet UIButton *button; 15 | 16 | @property (nonatomic) NSString *text; 17 | @end 18 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/FrontViewControllerLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // FrontViewControllerBlocksViewController.m 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import "FrontViewControllerLabel.h" 10 | #import "SWRevealViewController.h" 11 | 12 | @implementation FrontViewControllerLabel 13 | 14 | 15 | - (void)viewDidLoad 16 | { 17 | [super viewDidLoad]; 18 | 19 | _label.text = _text; 20 | 21 | SWRevealViewController *revealController = self.revealViewController; 22 | 23 | [self.view addGestureRecognizer:revealController.panGestureRecognizer]; 24 | [_button addTarget:revealController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchUpInside]; 25 | } 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/FrontViewControllerLabel.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 30 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Project-Prefix.pch: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #import 34 | 35 | #ifndef __IPHONE_4_0 36 | #warning "This project uses features only available in iOS SDK 4.0 and later." 37 | #endif 38 | 39 | #ifdef __OBJC__ 40 | #import 41 | #import 42 | #endif 43 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/RearMasterTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RearMasterTableViewController.h 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface RearMasterTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/RearMasterTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RearMasterTableViewController.m 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import "RearMasterTableViewController.h" 10 | 11 | #import "SWRevealViewController.h" 12 | 13 | #import "FrontViewControllerImage.h" 14 | #import "FrontViewControllerLabel.h" 15 | #import "RearTableViewController.h" 16 | 17 | 18 | @implementation RearMasterTableViewController 19 | { 20 | NSInteger _previouslySelectedRow; 21 | } 22 | 23 | - (id)initWithStyle:(UITableViewStyle)style 24 | { 25 | self = [super initWithStyle:style]; 26 | if (self) 27 | { 28 | // Custom initialization 29 | } 30 | return self; 31 | } 32 | 33 | - (void)viewDidLoad 34 | { 35 | [super viewDidLoad]; 36 | self.clearsSelectionOnViewWillAppear = NO; 37 | self.tableView.backgroundColor = [UIColor colorWithWhite:0.3 alpha:1.0]; 38 | self.tableView.separatorColor = [UIColor colorWithWhite:0.5 alpha:1.0]; 39 | } 40 | 41 | - (void)viewWillAppear:(BOOL)animated 42 | { 43 | } 44 | 45 | 46 | - (UIStatusBarStyle)preferredStatusBarStyle 47 | { 48 | return UIStatusBarStyleLightContent; 49 | } 50 | 51 | #pragma mark - Table view data source 52 | 53 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 54 | { 55 | _previouslySelectedRow = -1; 56 | return 1; 57 | } 58 | 59 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 60 | { 61 | return 6; 62 | } 63 | 64 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 65 | { 66 | static NSString *CellIdentifier = @"Cell"; 67 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 68 | if (cell == nil) 69 | { 70 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 71 | } 72 | 73 | NSString *text = nil; 74 | switch ( indexPath.row ) 75 | { 76 | case 0: text = @"heart.png"; break; 77 | case 1: text = @"skull.png"; break; 78 | case 2: text = @"gift.png"; break; 79 | case 3: text = @"airplane.png"; break; 80 | case 4: text = @"star.png"; break; 81 | case 5: text = @" ... More"; break; 82 | } 83 | 84 | cell.imageView.image = [UIImage imageNamed:text]; 85 | cell.imageView.frame = CGRectMake(0,0,44,44); 86 | cell.textLabel.text = text; 87 | cell.textLabel.textColor = [UIColor colorWithWhite:1.0 alpha:1.0]; 88 | return cell; 89 | } 90 | 91 | 92 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 93 | { 94 | cell.backgroundColor = self.tableView.backgroundColor; 95 | 96 | } 97 | 98 | #pragma mark - Table view delegate 99 | 100 | 101 | 102 | 103 | 104 | - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath 105 | { 106 | return indexPath; 107 | } 108 | 109 | 110 | 111 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 112 | { 113 | SWRevealViewController *revealController = self.revealViewController; 114 | 115 | NSInteger row = indexPath.row; 116 | 117 | if ( row == _previouslySelectedRow ) 118 | { 119 | [revealController revealToggleAnimated:YES]; 120 | return; 121 | } 122 | 123 | _previouslySelectedRow = row; 124 | 125 | NSString *text = nil; 126 | switch ( row ) 127 | { 128 | case 0: text = @"bg_flowers.jpg"; break; 129 | case 1: text = @"bg_blocks.jpg"; break; 130 | case 2: text = @"bg_grass.jpg"; break; 131 | case 3: text = @"Hello America!"; break; 132 | case 4: text = @"Best Wishes!"; break; 133 | } 134 | 135 | UIViewController *frontController = nil; 136 | switch ( row ) 137 | { 138 | case 0: 139 | case 1: 140 | case 2: 141 | { 142 | FrontViewControllerImage *imageController = [[FrontViewControllerImage alloc] init]; 143 | imageController.image = [UIImage imageNamed:text]; 144 | frontController = imageController; 145 | break; 146 | } 147 | 148 | case 3: 149 | case 4: 150 | { 151 | FrontViewControllerLabel *labelController = [[FrontViewControllerLabel alloc] init]; 152 | labelController.text = text; 153 | frontController = labelController; 154 | break; 155 | } 156 | 157 | case 5: 158 | { 159 | RearTableViewController *rearViewController = [[RearTableViewController alloc] init]; 160 | FrontViewControllerImage *frontViewController = [[FrontViewControllerImage alloc] init]; 161 | [frontViewController setImage:[UIImage imageNamed:@"bg_flowers.jpg"]]; 162 | 163 | SWRevealViewController *childRevealController = 164 | [[SWRevealViewController alloc] initWithRearViewController:rearViewController frontViewController:frontViewController]; 165 | 166 | #define NoRevealOverdraw true 167 | #if NoRevealOverdraw 168 | childRevealController.rearViewRevealWidth = 60; 169 | childRevealController.rearViewRevealOverdraw = 120; 170 | childRevealController.bounceBackOnOverdraw = NO; 171 | childRevealController.stableDragOnOverdraw = YES; 172 | #else 173 | childRevealController.rearViewRevealWidth = 200; 174 | #endif 175 | childRevealController.rearViewRevealDisplacement = 0; 176 | 177 | [childRevealController setFrontViewPosition:FrontViewPositionRight animated:NO]; 178 | frontController = childRevealController; 179 | break; 180 | } 181 | } 182 | 183 | if ( row != 5 ) 184 | { 185 | [revealController setFrontViewController:frontController animated:YES]; //sf 186 | [revealController setFrontViewPosition:FrontViewPositionRight animated:YES]; 187 | } 188 | else 189 | { 190 | [revealController setFrontViewController:frontController animated:YES]; //sf 191 | [revealController setFrontViewPosition:FrontViewPositionRightMost animated:YES]; 192 | } 193 | } 194 | 195 | @end 196 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/RearMasterTableViewControllerv.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/RearTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RearTableViewController.h 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface RearTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/RearTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RearTableViewController.m 3 | // RevealControllerProject3 4 | // 5 | // Created by Joan on 30/12/12. 6 | // 7 | // 8 | 9 | #import "RearTableViewController.h" 10 | 11 | #import "SWRevealViewController.h" 12 | 13 | #import "FrontViewControllerImage.h" 14 | #import "FrontViewControllerLabel.h" 15 | 16 | 17 | @implementation RearTableViewController 18 | { 19 | NSInteger _previouslySelectedRow; 20 | } 21 | 22 | 23 | - (id)initWithStyle:(UITableViewStyle)style 24 | { 25 | self = [super initWithStyle:style]; 26 | if (self) 27 | { 28 | // Custom initialization 29 | self.clearsSelectionOnViewWillAppear = NO; 30 | } 31 | return self; 32 | } 33 | 34 | 35 | - (void)viewDidLoad 36 | { 37 | [super viewDidLoad]; 38 | 39 | SWRevealViewController *revealController = self.revealViewController; 40 | SWRevealViewController *grandParentRevealController = revealController.revealViewController; 41 | 42 | [self.view addGestureRecognizer:grandParentRevealController.panGestureRecognizer]; 43 | 44 | 45 | // self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0); 46 | 47 | 48 | //[_button addTarget:revealController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchUpInside]; 49 | } 50 | 51 | //- (void)viewWillAppear:(BOOL)animated 52 | //{ 53 | // NSLog( @"%@: %d", NSStringFromSelector(_cmd), animated); 54 | //} 55 | // 56 | //- (void)viewDidAppear:(BOOL)animated 57 | //{ 58 | // 59 | // NSLog( @"%@: %d", NSStringFromSelector(_cmd), animated); 60 | //} 61 | // 62 | //- (void)viewWillDisappear:(BOOL)animated 63 | //{ 64 | // 65 | // NSLog( @"%@: %d", NSStringFromSelector(_cmd), animated); 66 | //} 67 | // 68 | //- (void)viewDidDisappear:(BOOL)animated 69 | //{ 70 | // 71 | // NSLog( @"%@: %d", NSStringFromSelector(_cmd), animated); 72 | //} 73 | 74 | 75 | #pragma mark - Table view data source 76 | 77 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 78 | { 79 | _previouslySelectedRow = -1; 80 | return 1; 81 | } 82 | 83 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 84 | { 85 | return 6; 86 | } 87 | 88 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 89 | { 90 | static NSString *CellIdentifier = @"Cell"; 91 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 92 | if (cell == nil) 93 | { 94 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 95 | } 96 | 97 | NSString *text = nil; 98 | switch ( indexPath.row ) 99 | { 100 | case 0: text = @"Image 1"; break; 101 | case 1: text = @"Image 2"; break; 102 | case 2: text = @"Image 3"; break; 103 | case 3: text = @"Label 1"; break; 104 | case 4: text = @"Label 2"; break; 105 | case 5: text = @"Label 3"; break; 106 | } 107 | 108 | cell.textLabel.text = text; 109 | return cell; 110 | } 111 | 112 | 113 | #pragma mark - Table view delegate 114 | 115 | 116 | - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath 117 | { 118 | return indexPath; 119 | } 120 | 121 | 122 | 123 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 124 | { 125 | SWRevealViewController *revealController = self.revealViewController; 126 | 127 | NSInteger row = indexPath.row; 128 | 129 | if ( row == _previouslySelectedRow ) 130 | { 131 | [revealController revealToggleAnimated:YES]; 132 | return; 133 | } 134 | 135 | _previouslySelectedRow = row; 136 | 137 | NSString *text = nil; 138 | switch ( row ) 139 | { 140 | case 0: text = @"bg_flowers.jpg"; break; 141 | case 1: text = @"bg_blocks.jpg"; break; 142 | case 2: text = @"bg_grass.jpg"; break; 143 | case 3: text = @"Hello World!"; break; 144 | case 4: text = @"Hello America!"; break; 145 | case 5: text = @"Best Wishes!"; break; 146 | } 147 | 148 | UIViewController *frontController = nil; 149 | switch ( row ) 150 | { 151 | case 0: 152 | case 1: 153 | case 2: 154 | frontController = [[FrontViewControllerImage alloc] init]; 155 | ((FrontViewControllerImage*)frontController).image = [UIImage imageNamed:text]; 156 | break; 157 | 158 | case 3: 159 | case 4: 160 | case 5: 161 | frontController = [[FrontViewControllerLabel alloc] init]; 162 | ((FrontViewControllerLabel*)frontController).text = text; 163 | break; 164 | } 165 | 166 | [revealController pushFrontViewController:frontController animated:YES]; 167 | } 168 | 169 | @end 170 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/RearTableViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/.DS_Store -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/airplane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/airplane.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/airplane@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/airplane@2x.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/bg_blocks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/bg_blocks.jpg -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/bg_flowers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/bg_flowers.jpg -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/bg_grass.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/bg_grass.jpg -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/gift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/gift.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/gift@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/gift@2x.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/heart.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/heart@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/heart@2x.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/ipod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/ipod.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/ipod@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/ipod@2x.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/reveal-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/reveal-icon.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/reveal-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/reveal-icon@2x.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/skull.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/skull@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/skull@2x.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/star.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/Resources/star@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/Resources/star@2x.png -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/RevealControllerProject-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | org.zuui.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | UIInterfaceOrientationPortraitUpsideDown 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/en.lproj/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerExample3/RevealControllerProject3/en.lproj/.DS_Store -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/en.lproj/FrontViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1938 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | IBUIButton 15 | IBUIView 16 | IBUILabel 17 | IBProxyObject 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 282 38 | 39 | 40 | 41 | 290 42 | {{20, 20}, {280, 37}} 43 | 44 | 45 | 46 | _NS:225 47 | NO 48 | IBCocoaTouchFramework 49 | 0 50 | 0 51 | 1 52 | Push! 53 | 54 | 3 55 | MQA 56 | 57 | 58 | 1 59 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 60 | 61 | 62 | 3 63 | MC41AA 64 | 65 | 66 | 2 67 | 15 68 | 69 | 70 | Helvetica-Bold 71 | 15 72 | 16 73 | 74 | 75 | 76 | 77 | 290 78 | {{20, 72}, {286, 88}} 79 | 80 | 81 | 82 | _NS:328 83 | NO 84 | YES 85 | 7 86 | NO 87 | IBCocoaTouchFramework 88 | Note: You may always reveal the rear view by panning your finger across the NavigationBar. 89 | 90 | 3 91 | MC4zMTE3MDE2NDIzAA 92 | 93 | 94 | 95 | {0, 1} 96 | 1 97 | 10 98 | 5 99 | 1 100 | 101 | 1 102 | 17 103 | 104 | 105 | Helvetica 106 | 17 107 | 16 108 | 109 | 110 | 111 | {{0, 64}, {320, 416}} 112 | 113 | 114 | 115 | 116 | 1 117 | MC44MjE5MDkyMTUzIDAuODYxMTk5ODE3NSAwLjkwNzc2MTE3NwA 118 | 119 | 120 | 121 | NO 122 | 123 | IBCocoaTouchFramework 124 | 125 | 126 | 127 | 128 | 129 | 130 | view 131 | 132 | 133 | 134 | 57 135 | 136 | 137 | 138 | pushExample: 139 | 140 | 141 | 7 142 | 143 | 59 144 | 145 | 146 | 147 | 148 | 149 | 0 150 | 151 | 152 | 153 | 154 | 155 | -1 156 | 157 | 158 | File's Owner 159 | 160 | 161 | -2 162 | 163 | 164 | 165 | 166 | 1 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 58 176 | 177 | 178 | 179 | 180 | 60 181 | 182 | 183 | 184 | 185 | 186 | 187 | FrontViewController 188 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 189 | UIResponder 190 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 191 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 192 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 193 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 194 | 195 | 196 | 197 | 198 | 199 | 60 200 | 201 | 202 | 203 | 204 | FrontViewController 205 | UIViewController 206 | 207 | pushExample: 208 | id 209 | 210 | 211 | pushExample: 212 | 213 | pushExample: 214 | id 215 | 216 | 217 | 218 | IBProjectSource 219 | ./Classes/FrontViewController.h 220 | 221 | 222 | 223 | 224 | 0 225 | IBCocoaTouchFramework 226 | YES 227 | 3 228 | 933 229 | 230 | 231 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /RevealControllerExample3/RevealControllerProject3/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #import 34 | #import "AppDelegate.h" 35 | 36 | int main(int argc, char *argv[]) 37 | { 38 | @autoreleasepool 39 | { 40 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /RevealControllerProject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerProject.png -------------------------------------------------------------------------------- /RevealControllerProject2_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerProject2_a.png -------------------------------------------------------------------------------- /RevealControllerProject3_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerProject3_a.png -------------------------------------------------------------------------------- /RevealControllerProject3_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerProject3_b.png -------------------------------------------------------------------------------- /RevealControllerProject3_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerProject3_c.png -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | #pragma mark state preservation / restoration 47 | 48 | - (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder 49 | { 50 | return YES; 51 | } 52 | 53 | - (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder 54 | { 55 | return YES; 56 | } 57 | 58 | - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions 59 | { 60 | //[self.window makeKeyAndVisible]; 61 | return YES; 62 | } 63 | @end 64 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/ColorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorViewController.h 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ColorViewController : UIViewController 12 | @property (nonatomic, strong) IBOutlet UILabel* label; 13 | @property (nonatomic, strong) UIColor* color; 14 | @property (nonatomic, strong) NSString* text; 15 | @end 16 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/ColorViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorViewController.m 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import "ColorViewController.h" 10 | 11 | @interface ColorViewController () 12 | @property (nonatomic) IBOutlet UIBarButtonItem* revealButtonItem; 13 | @end 14 | 15 | @implementation ColorViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | [self customSetup]; 21 | } 22 | 23 | 24 | - (void)customSetup 25 | { 26 | SWRevealViewController *revealViewController = self.revealViewController; 27 | if ( revealViewController ) 28 | { 29 | [self.revealButtonItem setTarget: revealViewController]; 30 | [self.revealButtonItem setAction: @selector( revealToggle: )]; 31 | [self.navigationController.navigationBar addGestureRecognizer:revealViewController.panGestureRecognizer]; 32 | } 33 | 34 | _label.text = _text; 35 | _label.textColor = _color; 36 | } 37 | 38 | 39 | #pragma mark state preservation / restoration 40 | 41 | - (void)encodeRestorableStateWithCoder:(NSCoder *)coder 42 | { 43 | NSLog(@"%s", __PRETTY_FUNCTION__); 44 | 45 | // Save what you need here 46 | [coder encodeObject: _text forKey: @"text"]; 47 | [coder encodeObject: _color forKey: @"color"]; 48 | 49 | [super encodeRestorableStateWithCoder:coder]; 50 | } 51 | 52 | 53 | - (void)decodeRestorableStateWithCoder:(NSCoder *)coder 54 | { 55 | NSLog(@"%s", __PRETTY_FUNCTION__); 56 | 57 | // Restore what you need here 58 | _color = [coder decodeObjectForKey: @"color"]; 59 | _text = [coder decodeObjectForKey: @"text"]; 60 | 61 | [super decodeRestorableStateWithCoder:coder]; 62 | } 63 | 64 | 65 | - (void)applicationFinishedRestoringState 66 | { 67 | NSLog(@"%s", __PRETTY_FUNCTION__); 68 | 69 | // Call whatever function you need to visually restore 70 | [self customSetup]; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/Default-568h@2x.png -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/Default.png -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/Default@2x.png -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/MapViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MapViewController.h 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MapViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/MapViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MapViewController.m 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import "MapViewController.h" 10 | 11 | @interface MapViewController () 12 | @property (nonatomic) IBOutlet UIBarButtonItem* revealButtonItem; 13 | @end 14 | 15 | @implementation MapViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | [self customSetup]; 21 | } 22 | 23 | - (void)customSetup 24 | { 25 | SWRevealViewController *revealViewController = self.revealViewController; 26 | if ( revealViewController ) 27 | { 28 | [self.revealButtonItem setTarget: self.revealViewController]; 29 | [self.revealButtonItem setAction: @selector( revealToggle: )]; 30 | [self.navigationController.navigationBar addGestureRecognizer: self.revealViewController.panGestureRecognizer]; 31 | } 32 | } 33 | 34 | #pragma mark state preservation / restoration 35 | 36 | - (void)encodeRestorableStateWithCoder:(NSCoder *)coder 37 | { 38 | NSLog(@"%s", __PRETTY_FUNCTION__); 39 | 40 | // Save what you need here 41 | 42 | [super encodeRestorableStateWithCoder:coder]; 43 | } 44 | 45 | 46 | - (void)decodeRestorableStateWithCoder:(NSCoder *)coder 47 | { 48 | NSLog(@"%s", __PRETTY_FUNCTION__); 49 | 50 | // Restore what you need here 51 | 52 | [super decodeRestorableStateWithCoder:coder]; 53 | } 54 | 55 | 56 | - (void)applicationFinishedRestoringState 57 | { 58 | NSLog(@"%s", __PRETTY_FUNCTION__); 59 | 60 | // Call whatever function you need to visually restore 61 | [self customSetup]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/MenuViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuViewController.h 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SWUITableViewCell : UITableViewCell 12 | @property (nonatomic) IBOutlet UILabel *label; 13 | @end 14 | 15 | @interface MenuViewController : UITableViewController 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/MenuViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MenuViewController.m 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import "MenuViewController.h" 10 | #import "ColorViewController.h" 11 | 12 | @implementation SWUITableViewCell 13 | @end 14 | 15 | @implementation MenuViewController 16 | 17 | 18 | - (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender 19 | { 20 | // configure the destination view controller: 21 | if ( [sender isKindOfClass:[UITableViewCell class]] ) 22 | { 23 | UILabel* c = [(SWUITableViewCell *)sender label]; 24 | UINavigationController *navController = segue.destinationViewController; 25 | ColorViewController* cvc = [navController childViewControllers].firstObject; 26 | if ( [cvc isKindOfClass:[ColorViewController class]] ) 27 | { 28 | cvc.color = c.textColor; 29 | cvc.text = c.text; 30 | } 31 | } 32 | } 33 | 34 | 35 | #pragma mark - Table view data source 36 | 37 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 38 | { 39 | return 1; 40 | } 41 | 42 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 43 | { 44 | return 3; 45 | } 46 | 47 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 48 | { 49 | static NSString *CellIdentifier = @"Cell"; 50 | 51 | switch ( indexPath.row ) 52 | { 53 | case 0: 54 | CellIdentifier = @"map"; 55 | break; 56 | 57 | case 1: 58 | CellIdentifier = @"blue"; 59 | break; 60 | 61 | case 2: 62 | CellIdentifier = @"red"; 63 | break; 64 | } 65 | 66 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier forIndexPath: indexPath]; 67 | 68 | return cell; 69 | } 70 | 71 | #pragma mark state preservation / restoration 72 | - (void)encodeRestorableStateWithCoder:(NSCoder *)coder { 73 | NSLog(@"%s", __PRETTY_FUNCTION__); 74 | 75 | // TODO save what you need here 76 | 77 | [super encodeRestorableStateWithCoder:coder]; 78 | } 79 | 80 | - (void)decodeRestorableStateWithCoder:(NSCoder *)coder { 81 | NSLog(@"%s", __PRETTY_FUNCTION__); 82 | 83 | // TODO restore what you need here 84 | 85 | [super decodeRestorableStateWithCoder:coder]; 86 | } 87 | 88 | - (void)applicationFinishedRestoringState { 89 | NSLog(@"%s", __PRETTY_FUNCTION__); 90 | 91 | // TODO call whatever function you need to visually restore 92 | } 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.codeveloper.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | MainStoryboard 29 | UIMainStoryboardFile~ipad 30 | MainStoryboard-iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'RevealControllerStoryboardExample' target in the 'RevealControllerStoryboardExample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | 15 | #import "SWRevealViewController.h" 16 | #endif 17 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RevealControllerStoryboardExample 4 | // 5 | // Created by Nick Hodapp on 1/9/13. 6 | // Copyright (c) 2013 CoDeveloper. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/reveal-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/reveal-icon.png -------------------------------------------------------------------------------- /RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/reveal-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Lluch/SWRevealViewController/bb4a110989d67a5fc5f5c533cacc92f6cb02f5e2/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/reveal-icon@2x.png -------------------------------------------------------------------------------- /SWRevealViewController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SWRevealViewController" 3 | s.version = "2.4.0" 4 | s.summary = "A UIViewController subclass for presenting two view controllers inspired in the Facebook app, done right." 5 | s.homepage = "https://github.com/John-Lluch/SWRevealViewController" 6 | s.license = "MIT" 7 | s.author = { "John Lluch Zorrilla" => "joan.lluch@sweetwilliamsl.com" } 8 | s.source = { :git => "https://github.com/John-Lluch/SWRevealViewController.git", :tag => "v#{s.version}" } 9 | s.platform = :ios, "7.0" 10 | s.source_files = "SWRevealViewController/*.{h,m}" 11 | s.framework = "CoreGraphics" 12 | s.requires_arc = true 13 | end 14 | --------------------------------------------------------------------------------