Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override var supportedInterfaceOrientations: UIInterfaceOrientationMask #328

Open
babynonkeyxs opened this issue Apr 11, 2022 · 1 comment

Comments

@babynonkeyxs
Copy link

if my baseNavigationController overwrite like this :

public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return self.visibleViewController?.supportedInterfaceOrientations ?? .portrait
}

and your AlertController overwrite like this :

public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return self.presentingViewController?.supportedInterfaceOrientations ?? super.supportedInterfaceOrientations
}

then visibleViewController of baseNavigationController isqual to SDCAlertController
and presentingViewController of AlertController isqual to baseNavigationController
circular reference

@sberrevoets
Copy link
Owner

I wouldn't use visibleViewController to determine the supported orientations, but rather topViewController. If that doesn't work, you'll have to check the class of visibleViewController first or keep a reference to the alert around and check that visibleViewController != alert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants