ios – 基于故事板模式登录屏幕的示例

我正在学习ios / xcode和路障.

我有一个tabbarcontroller导航的设计.如果用户没有登录,我需要提交登录屏幕.这是基本的父权制.登录页面需要一个导航栏(如我所遵循的教程在栏上放置一个“Go”按钮.

LoginController: (LTController.h,.m)

Main View:TabBarController>
                   NavigationController>View1>View1a
                   NavigationController>View2

我在模式视图,委托方法等上阅读了很多帖子.他们中的大多数都是代码片段,不幸的是我的初学者级别有点过头了.

会感谢一个简单的解释,如何实现这一点.文件需要更改的文件将会很好.

谢谢

解决方法

这是场景.这么简单我只希望这将是有用的.

对于UITableBarController,给出一个名称为storyboard id的身份

然后在您的ViewController类文件中您具有权限>.在那里做一些东西进行身份验证.然后按照这段代码.工作正常

- (IBAction)Login:(id)sender {

    if(authenticated)  // authenticated---> BOOL Value assign True only if Login Success
        {
            UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
            UITabBarController *obj=[storyboard instantiateViewControllerWithIdentifier:@"tab"];
            self.navigationController.navigationBarHidden=YES;
            [self.navigationController pushViewController:obj animated:YES];
        }

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...