Skip to content

Cannot access the rootViewController when using a SceneDelegate #68

@larry-cariq

Description

@larry-cariq

When an iOS app is using a SceneDelegate, this code does not work:
UIViewController *root = [[[[UIApplication sharedApplication] delegate] window] rootViewController];

Reference: https://stackoverflow.com/questions/74341479/unable-to-access-root-view-after-adding-scenedelegate-swift-5

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