Book Image

iOS Development with Xamarin Cookbook

By : Dimitrios Tavlikos (USD)
Book Image

iOS Development with Xamarin Cookbook

By: Dimitrios Tavlikos (USD)

Overview of this book

Table of Contents (22 chapters)
iOS Development with Xamarin Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Unwinding in storyboards


Another very useful feature of storyboards is unwinding. Unwinding is a process similar to that of a segue, but instead of presenting the next view controller, it reverses to a previous view controller in a storyboard. The great thing about it is that it allows us to go back to any view controller, not just the one that is right before the current controller we are in. This recipe will show how to use unwinding.

Getting ready

For this recipe, we will need the project StoryboardApp we created in the previous recipe. Open it in Xamarin Studio.

How to do it…

Perform the following steps to implement unwinding:

  1. Add a new class to the project and name it ModalController.

  2. Make the class a custom view controller, similar to FirstController and SecondController in the project, as follows:

    [Register("ModalController")]
    public class ModalController : UIViewController
    {
      public ModalController (IntPtr handle) : base(handle)
      {
      }
    }
  3. Add the following method in the FirstController...