Created
November 1, 2011 20:44
-
-
Save anujb/1331845 to your computer and use it in GitHub Desktop.
Custom Container Transition Workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyContainerViewController : UIViewController { | |
public MyContainerViewController() | |
: base() { | |
} | |
public void Handle_Button1_Clicked(object sender, EventArgs e) { | |
// ..Initialize myFirstChildViewController | |
// and mySecondChildViewController here. | |
this.Transition(myFirstChildViewController, mySecondChildViewController, 1.5, | |
UIViewAnimationOptions.AllowUserInteraction | UIViewAnimationOptions.LayoutSubviews | UIViewAnimationOptions.TransitionCurlUp, | |
DoAnimation, // this is a method below | |
() => { | |
// UICompletion handler is just a delegate, we're inside an anonymous delegate, fun stuff... | |
Console.WriteLine("Animation Finished!"); | |
}); | |
} | |
public void DoAnimation() { | |
myFirstChildViewController.View.Bounds = animateOutBounds; | |
mySecondChildViewController.View.Bounds = animateInBounds; | |
this.Button1.BackgroundColor = UIColor.Red; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment