UITabBarController を使用して切り替え可能な 3 つのビューを持つアプリに、登録ページと検証ページを追加しようとしています。登録ページは、このアプリの有効期間中に 1 回だけ表示する必要があります。ユーザーが登録されると、このビューはなくなり、確認ページに置き換えられます。ユーザー ID が確認されると、ユーザーはアプリを使用できるようになります。
AppDelegate には、登録ページをユーザーに表示する次のコードがあります。
RegistrationPage *registration = [[RegistrationPage alloc] initWithNibName:@"RegistrationPage" bundle:nil];
[self.window.rootViewController presentViewController:registration animated:YES completion:nil];
ユーザーが登録ページに入力して送信ボタンを押した後、次のコードを使用して登録ページを閉じ、確認ページを表示します。
VerificationPage *verification = [[VerificationPage alloc] initWithNibName:@"VerificationPage" bundle:nil];
[self dismissViewControllerAnimated:YES completion:^{
[self addVerificationPage];
}];
-(void) addVerificationPage
{
VerificationPage *verification = [[VerificationPage alloc] initWithNibName:@"VerificationPage" bundle:nil];
[self presentViewController:verification animated:YES completion:nil];
}
ただし、確認ページはまったく表示されません。誰かがこれで私を助けることができますか?
登録ページでもこれを試しましたが、どちらも機能しません:
VerificationPage *verification = [[VerificationPage alloc] initWithNibName:@"VerificationPage" bundle:nil];
[self dismissViewControllerAnimated:YES completion:^{
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:verification animated:YES]
}];