最初のView Controllerでこれを確認し、Terms and Conditionsビューを提示することをお勧めします. 以下は、View Controller からのビューを初期化して表示します。
UIViewController *tncView = [self.storyboard instantiateViewControllerWithIdentifier:@"TermsViewController"];
[tncView setModalInPopover:YES];
[tncView setModalPresentationStyle:UIModalPresentationFormSheet];
[tncView setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentViewController:tncView animated:YES completion:NULL];
次に、T&C ビュー コントローラーから終了します。
[self dismissViewControllerAnimated:YES completion:NULL];
更新: ビューに .xib ファイルを使用している場合は、次のように初期化します。
termsViewController *tncView = [[termsViewController alloc] initWithNibName:@"termsView" bundle:nil];
termsViewController
は EULA のビュー コントローラーのクラス名で、は拡張子を除いたxib termsView
/nib ファイルの名前です (iOS 4.0 以降では拡張子は必要ありません)。
nib/xib を使用せず、View Controller をプログラムで記述した場合:
termsViewController *tncView = [[termsViewController alloc] init];
ストーリーボードを使用する場合は、上に投稿したものを使用します。
UIViewController *tncView = [self.storyboard instantiateViewControllerWithIdentifier:@"TermsViewController"];
ビュー コントローラーを初期化したら、そのプレゼンテーション プロパティを設定します。
[tncView setModalInPopover:YES];
[tncView setModalPresentationStyle:UIModalPresentationFormSheet];
[tncView setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
そして最後に、ビューを提示します。私はあなたの最初のView ControllerのviewDidAppear
メソッドでそれを行います:
- (void)viewDidAppear:(BOOL)animated
{
[self presentViewController:tncView animated:YES completion:NULL];
}
これがうまくいくかどうか教えてください。