Skip to content

Instantly share code, notes, and snippets.

@RobertKozak
Created July 20, 2011 19:09
Show Gist options
  • Save RobertKozak/1095667 to your computer and use it in GitHub Desktop.
Save RobertKozak/1095667 to your computer and use it in GitHub Desktop.
public static void PushView(UIView view, UIViewController controller, bool animated)
{
CurrentViewController = controller;
NavigationController.PushViewController(CurrentViewController, animated);
}
public static void PushView(UIView view, Type controllerType, bool animated)
{
var controller = Activator.CreateInstance(controllerType) as UIViewController;
if (controller != null)
{
CurrentViewController = controller;
NavigationController.PushViewController(CurrentViewController, animated);
}
else
{
// throw and exception here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment