diff --git a/RevealControllerExample/RevealControllerProject/RearViewController.m b/RevealControllerExample/RevealControllerProject/RearViewController.m index a96e31c..2ade529 100755 --- a/RevealControllerExample/RevealControllerProject/RearViewController.m +++ b/RevealControllerExample/RevealControllerProject/RearViewController.m @@ -33,6 +33,9 @@ of this software and associated documentation files (the "Software"), to deal #import "MapViewController.h" @interface RearViewController() +{ + NSInteger _presentedRow; +} @end @@ -46,9 +49,9 @@ @implementation RearViewController - (void)viewDidLoad { - [super viewDidLoad]; + [super viewDidLoad]; - self.title = NSLocalizedString(@"Rear View", nil); + self.title = NSLocalizedString(@"Rear View", nil); } @@ -56,94 +59,94 @@ - (void)viewDidLoad - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 4; + return 4; } + - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString *cellIdentifier = @"Cell"; - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + static NSString *cellIdentifier = @"Cell"; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; NSInteger row = indexPath.row; + + if (nil == cell) + { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier]; + } - if (nil == cell) - { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier]; - } - - if (row == 0) - { - cell.textLabel.text = @"Front View Controller"; - } - else if (row == 1) - { - cell.textLabel.text = @"Map View Controller"; - } - else if (row == 2) - { - cell.textLabel.text = @"Enter Presentation Mode"; - } - else if (row == 3) - { - cell.textLabel.text = @"Resign Presentation Mode"; - } + NSString *text = nil; + if (row == 0) + { + text = @"Front View Controller"; + } + else if (row == 1) + { + text = @"Map View Controller"; + } + else if (row == 2) + { + text = @"Enter Presentation Mode"; + } + else if (row == 3) + { + text = @"Resign Presentation Mode"; + } + + cell.textLabel.text = NSLocalizedString( text,nil ); - return cell; + return cell; } + - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - // Grab a handle to the reveal controller, as if you'd do with a navigtion controller via self.navigationController. + // Grab a handle to the reveal controller, as if you'd do with a navigtion controller via self.navigationController. SWRevealViewController *revealController = self.revealViewController; - // We know the frontViewController is a NavigationController - UINavigationController *frontNavigationController = (id)revealController.frontViewController; // <-- we know it is a NavigationController + // selecting row NSInteger row = indexPath.row; - - // Here you'd implement some of your own logic... I simply take for granted that the first row (=0) corresponds to the "FrontViewController". - if (row == 0) - { - // Now let's see if we're not attempting to swap the current frontViewController for a new instance of ITSELF, which'd be highly redundant. - if ( ![frontNavigationController.topViewController isKindOfClass:[FrontViewController class]] ) - { - FrontViewController *frontViewController = [[FrontViewController alloc] init]; - UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; - [revealController pushFrontViewController:navigationController animated:YES]; - } - // Seems the user attempts to 'switch' to exactly the same controller he came from! - else - { - [revealController revealToggle:self]; - } - } - // ... and the second row (=1) corresponds to the "MapViewController". - else if (row == 1) - { - // Now let's see if we're not attempting to swap the current frontViewController for a new instance of ITSELF, which'd be highly redundant. - if ( ![frontNavigationController.topViewController isKindOfClass:[MapViewController class]] ) - { - MapViewController *mapViewController = [[MapViewController alloc] init]; - UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:mapViewController]; - [revealController pushFrontViewController:navigationController animated:YES]; - } - - // Seems the user attempts to 'switch' to exactly the same controller he came from! - else - { - [revealController revealToggle:self]; - } - } - else if (row == 2) - { + // if we are trying to push the same row or perform an operation that does not imply frontViewController replacement + // we'll just set position and return + + if ( row == _presentedRow ) + { + [revealController setFrontViewPosition:FrontViewPositionLeft animated:YES]; + return; + } + else if (row == 2) + { [revealController setFrontViewPosition:FrontViewPositionRightMost animated:YES]; - } - else if (row == 3) - { + return; + } + else if (row == 3) + { [revealController setFrontViewPosition:FrontViewPositionRight animated:YES]; - } + return; + } + + // otherwise we'll create a new frontViewController and push it with animation + + UIViewController *newFrontController = nil; + + if (row == 0) + { + newFrontController = [[FrontViewController alloc] init]; + } + + else if (row == 1) + { + newFrontController = [[MapViewController alloc] init]; + } + + UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:newFrontController]; + [revealController pushFrontViewController:navigationController animated:YES]; + + _presentedRow = row; // <- store the presented row } + //- (void)viewWillAppear:(BOOL)animated //{ // [super viewWillAppear:animated]; diff --git a/RevealControllerExample2/RevealControllerProject2/RearViewController.m b/RevealControllerExample2/RevealControllerProject2/RearViewController.m index 6cbedb7..2e26208 100755 --- a/RevealControllerExample2/RevealControllerProject2/RearViewController.m +++ b/RevealControllerExample2/RevealControllerProject2/RearViewController.m @@ -29,6 +29,9 @@ of this software and associated documentation files (the "Software"), to deal #import "MapViewController.h" @interface RearViewController() +{ + NSInteger _presentedRow; +} @end @@ -37,26 +40,26 @@ @implementation RearViewController @synthesize rearTableView = _rearTableView; /* - * The following lines are crucial to understanding how the SWRevealController works. + * The following lines are crucial to understanding how the SWRevealViewController works. * - * In this example, we show how a SWRevealController can be contained in another instance + * In this example, we show how a SWRevealViewController can be contained in another instance * of the same class. We have three scenarios of hierarchies as follows * * In the first scenario a FrontViewController is contained inside of a UINavigationController. - * And the UINavigationController is contained inside of a SWRevealController. Thus the + * And the UINavigationController is contained inside of a SWRevealViewController. Thus the * following hierarchy is created: * - * - SWRevealController is parent of: + * - SWRevealViewController is parent of: * - 1 UINavigationController is parent of: * - - 1.1 RearViewController * - 2 UINavigationController is parent of: * - - 2.1 FrontViewController * * In the second scenario a MapViewController is contained inside of a UINavigationController. - * And the UINavigationController is contained inside of a SWRevealController. Thus the + * And the UINavigationController is contained inside of a SWRevealViewController. Thus the * following hierarchy is created: * - * - SWRevealController is parent of: + * - SWRevealViewController is parent of: * - 1 UINavigationController is parent of: * - - 1.1 RearViewController * - 2 UINavigationController is parent of: @@ -65,12 +68,13 @@ @implementation RearViewController * In the third scenario a SWRevealViewController is contained directly inside of another. * SWRevealController. Thus the following hierarchy is created: * - * - SWRevealController is parent of: + * - SWRevealViewController is parent of: * - 1 UINavigationController is parent of: * - - 1.1 RearViewController - * - 2 SWRevealController + * - 2 SWRevealViewController + * - - ... * - * The second SWRevealController on the third scenario can in turn contain anything. + * The second SWRevealViewController on the third scenario can in turn contain anything. * On this example it may recursively contain any of the above, including again the third one */ @@ -87,7 +91,7 @@ - (void)viewDidLoad // if we have a reveal controller as a grand parent, this means we are are being added as a // child of a detail (child) reveal controller, so we add a gesture recognizer provided by our grand parent to our - // navigation bar as well as a "reveal" button + // navigation bar as well as a "reveal" button, we also set if ( grandParentRevealController ) { // to present a title, we count the number of ancestor reveal controllers we have, this is of course @@ -111,6 +115,21 @@ - (void)viewDidLoad } } +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + SWRevealViewController *grandParentRevealController = self.revealViewController.revealViewController; + grandParentRevealController.bounceBackOnOverdraw = NO; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + + SWRevealViewController *grandParentRevealController = self.revealViewController.revealViewController; + grandParentRevealController.bounceBackOnOverdraw = YES; +} #pragma marl - UITableView Data Source @@ -131,111 +150,97 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier]; } + NSString *text = nil; if (row == 0) { - cell.textLabel.text = @"Front View Controller"; + text = @"Front View Controller"; } else if (row == 1) { - cell.textLabel.text = @"Map View Controller"; + text = @"Map View Controller"; } else if (row == 2) { - cell.textLabel.text = @"Enter Presentation Mode"; + text = @"Enter Presentation Mode"; } else if (row == 3) { - cell.textLabel.text = @"Resign Presentation Mode"; + text = @"Resign Presentation Mode"; } - else if (row == 4) { - cell.textLabel.text = @"A RevealViewController !!"; + text = @"A RevealViewController !!"; } + + cell.textLabel.text = NSLocalizedString( text, nil ); return cell; } + - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - SWRevealViewController *revealController = [self revealViewController]; - UIViewController *frontViewController = revealController.frontViewController; - UINavigationController *frontNavigationController =nil; - - if ( [frontViewController isKindOfClass:[UINavigationController class]] ) - frontNavigationController = (id)frontViewController; + // Grab a handle to the reveal controller, as if you'd do with a navigtion controller via self.navigationController. + SWRevealViewController *revealController = self.revealViewController; + // selecting row NSInteger row = indexPath.row; - - // Here you'd implement some of your own logic... I simply take for granted that the first row (=0) corresponds to the "FrontViewController". - if (row == 0) - { - // Now let's see if we're not attempting to swap the current frontViewController for a new instance of ITSELF, which'd be highly redundant. - if ( ![frontNavigationController.topViewController isKindOfClass:[FrontViewController class]] ) - { - FrontViewController *frontViewController = [[FrontViewController alloc] init]; - UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; - [revealController pushFrontViewController:navigationController animated:YES]; - } - // Seems the user attempts to 'switch' to exactly the same controller he came from! - else - { - [revealController revealToggleAnimated:YES]; - } - } - // ... and the second row (=1) corresponds to the "MapViewController". - else if (row == 1) - { - // Now let's see if we're not attempting to swap the current frontViewController for a new instance of ITSELF, which'd be highly redundant. - if ( ![frontNavigationController.topViewController isKindOfClass:[MapViewController class]] ) - { - MapViewController *mapViewController = [[MapViewController alloc] init]; - UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:mapViewController]; - [revealController pushFrontViewController:navigationController animated:YES]; - } - - // Seems the user attempts to 'switch' to exactly the same controller he came from! - else - { - [revealController revealToggleAnimated:YES]; - } - } - else if (row == 2) - { + // if we are trying to push the same row or perform an operation that does not imply frontViewController replacement + // we'll just set position and return + + if ( row == _presentedRow ) + { + [revealController setFrontViewPosition:FrontViewPositionLeft animated:YES]; + return; + } + else if (row == 2) + { [revealController setFrontViewPosition:FrontViewPositionRightMost animated:YES]; - } - else if (row == 3) - { + return; + } + else if (row == 3) + { [revealController setFrontViewPosition:FrontViewPositionRight animated:YES]; - } + return; + } + + // otherwise we'll create a new frontViewController and push it with animation + + UIViewController *newFrontController = nil; + + if (row == 0) + { + FrontViewController *frontViewController = [[FrontViewController alloc] init]; + newFrontController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; + } - else if (row == 4) - { - if ( ![frontViewController isKindOfClass:[SWRevealViewController class]] && - ![frontNavigationController.topViewController isKindOfClass:[SWRevealViewController class]]) - { - FrontViewController *frontViewController = [[FrontViewController alloc] init]; - RearViewController *rearViewController = [[RearViewController alloc] init]; - - UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; - UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController]; - - SWRevealViewController *childRevealController = [[SWRevealViewController alloc] - initWithRearViewController:rearNavigationController frontViewController:frontNavigationController]; - - childRevealController.rearViewRevealDisplacement = 0.0f; - revealController.bounceBackOnOverdraw = NO; - [childRevealController setFrontViewPosition:FrontViewPositionRight animated:NO]; + else if (row == 1) + { + MapViewController *mapViewController = [[MapViewController alloc] init]; + newFrontController = [[UINavigationController alloc] initWithRootViewController:mapViewController]; + } + + else if ( row == 4 ) + { + FrontViewController *frontViewController = [[FrontViewController alloc] init]; + UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController]; + + RearViewController *rearViewController = [[RearViewController alloc] init]; + UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController]; + + SWRevealViewController *childRevealController = [[SWRevealViewController alloc] + initWithRearViewController:rearNavigationController frontViewController:frontNavigationController]; - // at this point we simply set the front view controller of our revealController to the next revealController - [revealController pushFrontViewController:childRevealController animated:YES]; - } - else - { - [revealController revealToggleAnimated:YES]; - } - } + childRevealController.rearViewRevealDisplacement = 0.0f; + [childRevealController setFrontViewPosition:FrontViewPositionRight animated:NO]; + + newFrontController = childRevealController; + } + + [revealController pushFrontViewController:newFrontController animated:YES]; + + _presentedRow = row; // <- store the presented row } diff --git a/RevealControllerExample3/RevealControllerProject3.xcodeproj/project.pbxproj b/RevealControllerExample3/RevealControllerProject3.xcodeproj/project.pbxproj index c6ba78c..40bb92f 100755 --- a/RevealControllerExample3/RevealControllerProject3.xcodeproj/project.pbxproj +++ b/RevealControllerExample3/RevealControllerProject3.xcodeproj/project.pbxproj @@ -7,12 +7,14 @@ objects = { /* Begin PBXBuildFile section */ + 4E17A514197C612B00D126E4 /* FrontViewControllerLabel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAF2316905A81005862CE /* FrontViewControllerLabel.xib */; }; + 4E17A515197C613300D126E4 /* FrontViewControllerImage.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAEF9169055FF005862CE /* FrontViewControllerImage.xib */; }; + 4E17A516197C614200D126E4 /* RearTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAF2E16905DE9005862CE /* RearTableViewController.xib */; }; + 4E17A517197C614500D126E4 /* RearMasterTableViewControllerv.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4E523226169088D200A13268 /* RearMasterTableViewControllerv.xib */; }; 4E235CC6168F9C6500223C30 /* reveal-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E235CC4168F9C6500223C30 /* reveal-icon.png */; }; 4E235CC7168F9C6500223C30 /* reveal-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E235CC5168F9C6500223C30 /* reveal-icon@2x.png */; }; 4E523227169088D200A13268 /* RearMasterTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E523225169088D200A13268 /* RearMasterTableViewController.m */; }; - 4E523228169088D200A13268 /* RearMasterTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4E523226169088D200A13268 /* RearMasterTableViewController.xib */; }; 4ECAAEFA169055FF005862CE /* FrontViewControllerImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ECAAEF8169055FF005862CE /* FrontViewControllerImage.m */; }; - 4ECAAEFB169055FF005862CE /* FrontViewControllerImage.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAEF9169055FF005862CE /* FrontViewControllerImage.xib */; }; 4ECAAF0E16905677005862CE /* airplane.png in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAEFD16905677005862CE /* airplane.png */; }; 4ECAAF0F16905677005862CE /* airplane@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAEFE16905677005862CE /* airplane@2x.png */; }; 4ECAAF1016905677005862CE /* bg_blocks.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAEFF16905677005862CE /* bg_blocks.jpg */; }; @@ -29,9 +31,7 @@ 4ECAAF1D16905677005862CE /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAF0C16905677005862CE /* star.png */; }; 4ECAAF1E16905677005862CE /* star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAF0D16905677005862CE /* star@2x.png */; }; 4ECAAF2416905A81005862CE /* FrontViewControllerLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ECAAF2216905A81005862CE /* FrontViewControllerLabel.m */; }; - 4ECAAF2516905A81005862CE /* FrontViewControllerLabel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAF2316905A81005862CE /* FrontViewControllerLabel.xib */; }; 4ECAAF2F16905DE9005862CE /* RearTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ECAAF2D16905DE9005862CE /* RearTableViewController.m */; }; - 4ECAAF3016905DE9005862CE /* RearTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4ECAAF2E16905DE9005862CE /* RearTableViewController.xib */; }; 4EDE1D03168F0648005656D1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EDE1D02168F0648005656D1 /* AppDelegate.m */; }; 4EDE1D0C168F06A5005656D1 /* SWRevealViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EDE1D0B168F06A5005656D1 /* SWRevealViewController.m */; }; 4EDE1D0F168F06D6005656D1 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EDE1D0E168F06D6005656D1 /* Default-568h@2x.png */; }; @@ -48,7 +48,7 @@ 4E235CC5168F9C6500223C30 /* reveal-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "reveal-icon@2x.png"; path = "Resources/reveal-icon@2x.png"; sourceTree = ""; }; 4E523224169088D200A13268 /* RearMasterTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RearMasterTableViewController.h; sourceTree = ""; }; 4E523225169088D200A13268 /* RearMasterTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RearMasterTableViewController.m; sourceTree = ""; }; - 4E523226169088D200A13268 /* RearMasterTableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RearMasterTableViewController.xib; sourceTree = ""; }; + 4E523226169088D200A13268 /* RearMasterTableViewControllerv.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RearMasterTableViewControllerv.xib; sourceTree = ""; }; 4ECAAEF7169055FF005862CE /* FrontViewControllerImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrontViewControllerImage.h; sourceTree = ""; }; 4ECAAEF8169055FF005862CE /* FrontViewControllerImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FrontViewControllerImage.m; sourceTree = ""; }; 4ECAAEF9169055FF005862CE /* FrontViewControllerImage.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FrontViewControllerImage.xib; sourceTree = ""; }; @@ -151,7 +151,7 @@ children = ( 4E523224169088D200A13268 /* RearMasterTableViewController.h */, 4E523225169088D200A13268 /* RearMasterTableViewController.m */, - 4E523226169088D200A13268 /* RearMasterTableViewController.xib */, + 4E523226169088D200A13268 /* RearMasterTableViewControllerv.xib */, ); name = RearMasterTableViewController; sourceTree = ""; @@ -294,28 +294,28 @@ buildActionMask = 2147483647; files = ( 5E605BB414A081F900853025 /* InfoPlist.strings in Resources */, + 4E17A515197C613300D126E4 /* FrontViewControllerImage.xib in Resources */, 4EDE1D0F168F06D6005656D1 /* Default-568h@2x.png in Resources */, 4E235CC6168F9C6500223C30 /* reveal-icon.png in Resources */, 4E235CC7168F9C6500223C30 /* reveal-icon@2x.png in Resources */, - 4ECAAEFB169055FF005862CE /* FrontViewControllerImage.xib in Resources */, 4ECAAF0E16905677005862CE /* airplane.png in Resources */, 4ECAAF0F16905677005862CE /* airplane@2x.png in Resources */, 4ECAAF1016905677005862CE /* bg_blocks.jpg in Resources */, 4ECAAF1116905677005862CE /* bg_flowers.jpg in Resources */, 4ECAAF1216905677005862CE /* bg_grass.jpg in Resources */, 4ECAAF1316905677005862CE /* gift.png in Resources */, + 4E17A516197C614200D126E4 /* RearTableViewController.xib in Resources */, 4ECAAF1416905677005862CE /* gift@2x.png in Resources */, 4ECAAF1516905677005862CE /* heart.png in Resources */, 4ECAAF1616905677005862CE /* heart@2x.png in Resources */, + 4E17A517197C614500D126E4 /* RearMasterTableViewControllerv.xib in Resources */, + 4E17A514197C612B00D126E4 /* FrontViewControllerLabel.xib in Resources */, 4ECAAF1716905677005862CE /* ipod.png in Resources */, 4ECAAF1816905677005862CE /* ipod@2x.png in Resources */, 4ECAAF1B16905677005862CE /* skull.png in Resources */, 4ECAAF1C16905677005862CE /* skull@2x.png in Resources */, 4ECAAF1D16905677005862CE /* star.png in Resources */, 4ECAAF1E16905677005862CE /* star@2x.png in Resources */, - 4ECAAF2516905A81005862CE /* FrontViewControllerLabel.xib in Resources */, - 4ECAAF3016905DE9005862CE /* RearTableViewController.xib in Resources */, - 4E523228169088D200A13268 /* RearMasterTableViewController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/RevealControllerExample3/RevealControllerProject3/RearMasterTableViewController.xib b/RevealControllerExample3/RevealControllerProject3/RearMasterTableViewControllerv.xib similarity index 69% rename from RevealControllerExample3/RevealControllerProject3/RearMasterTableViewController.xib rename to RevealControllerExample3/RevealControllerProject3/RearMasterTableViewControllerv.xib index f6b3582..485017e 100644 --- a/RevealControllerExample3/RevealControllerProject3/RearMasterTableViewController.xib +++ b/RevealControllerExample3/RevealControllerProject3/RearMasterTableViewControllerv.xib @@ -1,8 +1,7 @@ - + - - + @@ -15,12 +14,18 @@ - - - \ No newline at end of file + + + + + + + + + diff --git a/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/MenuViewController.m b/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/MenuViewController.m index 072b6a9..432f7b0 100755 --- a/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/MenuViewController.m +++ b/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/MenuViewController.m @@ -14,37 +14,6 @@ @implementation SWUITableViewCell @implementation MenuViewController -- (void) prepareForSegueB: (UIStoryboardSegue *) segue sender: (id) sender -{ - // configure the destination view controller: - if ( [segue.destinationViewController isKindOfClass: [ColorViewController class]] && - [sender isKindOfClass:[UITableViewCell class]] ) - { - UILabel* c = [(SWUITableViewCell *)sender label]; - ColorViewController* cvc = segue.destinationViewController; - - cvc.color = c.textColor; - cvc.text = c.text; - } - - // configure the segue. - if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) - { - SWRevealViewControllerSegue* rvcs = (SWRevealViewControllerSegue*) segue; - - SWRevealViewController* rvc = self.revealViewController; - NSAssert( rvc != nil, @"oops! must have a revealViewController" ); - - NSAssert( [rvc.frontViewController isKindOfClass: [UINavigationController class]], @"oops! for this segue we want a permanent navigation controller in the front!" ); - - rvcs.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) - { - UINavigationController* nc = [[UINavigationController alloc] initWithRootViewController:dvc]; - [rvc pushFrontViewController:nc animated:YES]; - }; - } -} - - (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender { diff --git a/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/MainStoryboard-iPad.storyboard b/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/MainStoryboard-iPad.storyboard index 9f45ecb..66d51dc 100755 --- a/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/MainStoryboard-iPad.storyboard +++ b/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/MainStoryboard-iPad.storyboard @@ -1,8 +1,8 @@ - + - - + + @@ -114,7 +114,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -208,7 +208,10 @@ - + + + + diff --git a/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/MainStoryboard.storyboard b/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/MainStoryboard.storyboard index 7224f31..5f44ac6 100755 --- a/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/MainStoryboard.storyboard +++ b/RevealControllerStoryboardExample2/RevealControllerStoryboardExample2/en.lproj/MainStoryboard.storyboard @@ -1,8 +1,9 @@ - + - + + @@ -33,7 +34,7 @@ - + @@ -53,20 +54,17 @@ - + - - - - -