element-ios/Riot/Categories/UINavigationController+Riot.m
2024-09-25 12:24:52 +02:00

44 lines
933 B
Objective-C

/*
Copyright 2024 New Vector Ltd.
Copyright 2017 Vector Creations Ltd
Copyright 2016 OpenMarket Ltd
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
#import "UINavigationController+Riot.h"
@implementation UINavigationController (Riot)
- (BOOL)shouldAutorotate
{
if (self.topViewController)
{
return [self.topViewController shouldAutorotate];
}
return YES;
}
-(UIInterfaceOrientationMask)supportedInterfaceOrientations
{
if (self.topViewController)
{
return [self.topViewController supportedInterfaceOrientations];
}
return UIInterfaceOrientationMaskAll;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
if (self.topViewController)
{
return [self.topViewController preferredInterfaceOrientationForPresentation];
}
return UIInterfaceOrientationPortrait;
}
@end