Skip to content

Instantly share code, notes, and snippets.

@anujb
Created November 1, 2011 20:44
Show Gist options
  • Save anujb/1331845 to your computer and use it in GitHub Desktop.
Save anujb/1331845 to your computer and use it in GitHub Desktop.
Custom Container Transition Workflow
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