I currently need to navigate from a UIViewController to a ContentPage in IOS. I am creating the UIViewController by calling the following code through a dependency:
[assembly: Xamarin.Forms.Dependency(typeof(ChartDisplay_iOS))]
namespace SurveyProject.iOS
{
public class ChartDisplay_iOS:IChartDisplay
{
public ChartDisplay_iOS ()
{
}
public void openChartView(Page nextPage)
{
var appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate;
appDelegate.loadChartDisplay (nextPage);
}
}
}
Then in the appDelegate Class the following is defined:
public void loadChartDisplay(Page nextPage)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
ChartDisplay viewController;
viewController = new ChartDisplay (nextPage);
window.RootViewController = viewController;
window.MakeKeyAndVisible ();
}
and then to close the page and navigate to a Forms contentpage I do the following in the appDelegate class:
public void closeChartDisplay(Page nextPage)
{
window.RootViewController = App.GetPageNavigateTo(nextPage).CreateViewController ();
window.MakeKeyAndVisible ();
}
This creates a new Content Page every time and I need to go to the exiting Content Page. Is it possible for someone to direct me to some content that could explain how to navigate between Forms Content Pages and UIViewController pages in IOS?