gonzooin
03/10/2020, 12:50 PMsupportedInterfaceOrientations
Anyone know how to achieve this ?Sam
03/10/2020, 1:03 PMgonzooin
03/10/2020, 1:11 PM@property(nonatomic, readonly) UIInterfaceOrientationMask supportedInterfaceOrientations;
according to apple documentation.
https://developer.apple.com/documentation/uikit/uiviewcontroller/1621435-supportedinterfaceorientations?language=objc@UseExperimental(ExperimentalUnsignedTypes::class)
override fun application(
application: UIApplication,
supportedInterfaceOrientationsForWindow: UIWindow?
): UIInterfaceOrientationMask {
val isIphone = UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPhone
if (isIphone) {
return UIInterfaceOrientationMaskPortrait or UIInterfaceOrientationMaskPortraitUpsideDown
}
return UIInterfaceOrientationMaskAll
}