Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Calling incorrect methods on left / right UIViewController's on state change #20

Merged
merged 1 commit into from

2 participants

@jklp

Hi, I noticed that when changing paper fold states in the PaperFoldNavigationController, the nav controller was calling viewDidLoad / viewDidAppear on the incorrect UIViewControllers.

I've updated so it is calling the right UIViewControllers now.

I have also added calls to viewWillDisapper and viewDidDisappear methods as I found my code also required them (and is good to have for completeness).

Great little module btw, very impressed with your work!

Thanks
Jerrold

@jklp jklp Calling incorrect methods on left / right UIViewController's on state…
… change

When changing paper fold states, was calling incorrect viewDidLoad /
viewDidAppear on the incorrect UIViewControllers.

Also added calls to viewWillDisapper and viewDidDisappear methods
f607429
@honcheng honcheng merged commit 7b532d8 into honcheng:master
@honcheng
Owner

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 27, 2012
  1. @jklp

    Calling incorrect methods on left / right UIViewController's on state…

    jklp authored
    … change
    
    When changing paper fold states, was calling incorrect viewDidLoad /
    viewDidAppear on the incorrect UIViewControllers.
    
    Also added calls to viewWillDisapper and viewDidDisappear methods
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 4 deletions.
  1. +20 −4 PaperFold/PaperFold/PaperFold/PaperFoldNavigationController.m
View
24 PaperFold/PaperFold/PaperFold/PaperFoldNavigationController.m
@@ -54,18 +54,34 @@ - (void)paperFoldView:(id)paperFoldView didFoldAutomatically:(BOOL)automated toS
{
if (paperFoldState==PaperFoldStateDefault)
{
- [self.leftViewController viewWillAppear:YES];
- [self.leftViewController viewDidAppear:YES];
+ [self.rootViewController viewWillAppear:YES];
+ [self.rootViewController viewDidAppear:YES];
+
+ if (self.rightViewController) {
+ [self.rightViewController viewWillDisappear:YES];
+ [self.rightViewController viewDidDisappear:YES];
+ }
+
+ if (self.leftViewController) {
+ [self.leftViewController viewWillDisappear:YES];
+ [self.leftViewController viewDidDisappear:YES];
+ }
}
else if (paperFoldState==PaperFoldStateLeftUnfolded)
{
- [self.rootViewController viewWillAppear:YES];
- [self.rootViewController viewDidAppear:YES];
+ [self.leftViewController viewWillAppear:YES];
+ [self.leftViewController viewDidAppear:YES];
+
+ [self.rootViewController viewWillDisappear:YES];
+ [self.rootViewController viewDidDisappear:YES];
}
else if (paperFoldState==PaperFoldStateRightUnfolded)
{
[self.rightViewController viewWillAppear:YES];
[self.rightViewController viewDidAppear:YES];
+
+ [self.rootViewController viewWillDisappear:YES];
+ [self.rootViewController viewDidDisappear:YES];
}
}
Something went wrong with that request. Please try again.