我正在为我的应用程序使用 Storyboard。
- (IBAction)LogInButtonClicked:(id)sender {
NSLog(@"clicked");
[PFUser logInWithUsernameInBackground:_mailAddressTextField.text password:_passwordTextField.text
block:^(PFUser *user, NSError *error) {
if (user) {
NSLog(@"Login correct");
// show tabBarConroller
} else {
[self showAlertwithMesage];
}
}];
如果登录正确,我如何从 Storyboard 中显示我的 tabBarController? 如果我向登录按钮添加 Segue,则 tabBarConroller 将始终显示。 但如果登录正确,我想显示 tabBarConroller
到目前为止我找到的解决方案并没有解决我的问题。
最佳答案
您可以在 Storyboard中将 Storyboard ID 分配给 TabBarController
。
登录成功时显示标签栏。
UITabBarController *myController = [self.storyboard instantiateViewControllerWithIdentifier:@"yourStoryBoardID"];
[self presentViewController:myController animated:YES completion:nil];
关于ios - 以编程方式显示带有 Storyboard的 TabBarConroller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29498392/