プログラムでviewControllerを作成しましたが、デバイスが回転するたびに強制的に回転させたいと考えています。単純なviewControllerでは、新しいファイルを追加することで通常の方法を使用して作成するため、「shouldAutoRotate」メソッドがあります。しかし、私の場合は、viewControllerでこのviewControllerを作成することは特に異なります。
新しいviewControllerを作成したくありません。
これは私がビューコントローラーを作成するために使用したコードです
UIViewController *featuresViewController = [[UIViewController alloc]initWithNibName:@"featrures" bundle:nil];
[featuresViewController setView:[[UIView alloc]initWithFrame:CGRectMake(10, 10, 380, 450 )]];
[featuresViewController.view setBackgroundColor:[UIColor clearColor]];
featuresViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl;
featuresViewController.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentModalViewController:featuresViewController animated:YES];