Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom transition between view controllers in ios6
    primarykey
    data
    text
    <p>I have a transition class that has two views in the same view controller. This works ok. I want to apply the same transition to a second view controller. I'm not getting any exceptions, but it isn't working...</p> <p>The current transition code is like this:</p> <p>Custom Transition class</p> <pre><code>- (id)initWithBaseView:(UIView *)baseView firstView:(UIView *)firstView lastView:(UIView *)lastView { if((self = [super init])) { self.view = baseView; self.originalView = firstView; self.nextView = lastView; } return self; } </code></pre> <p>This is the code that is working:</p> <p>Single View Controller class</p> <pre><code>- (IBAction)doTransition:(id)sender { MyTransition *transition = [[MyTransition alloc] initWithBaseView:self.view firstView:self.currentView lastView:self.nextView]; [transition buildAnimation]; } </code></pre> <p>I would like to achieve something like this:</p> <pre><code>- (IBAction)doTransition:(id)sender { NSLog(@"%s", __FUNCTION__); MyTransition *transition = [[MyTransition alloc] initWithBaseView:self.view firstView:self.currentView lastView:secondView.lastView]; [transition buildAnimation]; } - (void)viewDidLoad { NSLog(@"%s", __FUNCTION__); [super viewDidLoad]; secondView = [[SecondViewController *) secondView initWithNibName:@"SecondViewController" bundle:nil]; } </code></pre> <p>where First View is in the firstView Controller and next view is in the second view controller..</p> <p>UPDATE:</p> <p>I've updated the First VC as follows:</p> <pre><code> - (void)viewDidLoad { NSLog(@"%s", __FUNCTION__); [super viewDidLoad]; secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; } - (IBAction)doTransition:(id)sender { NSLog(@"%s", __FUNCTION__); MyTransition *transition = [[MyTransition alloc] initWithBaseView:self.view firstView:self.currentView lastView:secondView.view]; [transition buildAnimation]; } </code></pre> <p>Logging the second VC shows that it is not called..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload