Open babynonkeyxs opened 2 years ago
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
.
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