Skip to content

Can't get TopViewController in iOS native layter #18

@ewoody

Description

@ewoody

Here is how we want to get the top view controller in Xamarin iOS native layer,

               vc = UIApplication.SharedApplication.KeyWindow.RootViewController;

                while (vc.PresentedViewController != null)
                {
                    vc = vc.PresentedViewController;
                }
                if (vc is UINavigationController)
                {
                    vc = ((UINavigationController)vc).TopViewController;
                }

However, we can't get correct top view controller when we are navigating to a page but It works fine if the top page is a modal page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions