goal c – How can I power orientation for a sure viewController just for iOS 15.4.1?


I’ve an software that may run on each iPad and iPhone. I Have to hardcode the orientation for a selected viewController for x cause. Can we nonetheless try this on ios 15.4.1 in Goal-c? I Know this query have been requested previously however i couldn’t discover any reply they usually have been requested in earlier ios model.

I attempted this :

-(BOOL)shouldAutorotate {
    return YES;
}

-(UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

And this :

NSNumber *worth = [NSNumber numberWithInt:UIInterfaceOrientationMaskPortrait];
    [[UIDevice currentDevice] setValue:worth forKey:@"orientation"];
    [UIViewController attemptRotationToDeviceOrientation];

And rather more. nothing labored to date.

Thanks.

See also  ios - GIPHY Gif pictures not loading till person scrolls

Leave a Reply