在swrevealcontroller之前实现登录屏幕 [英] implement login screen before swrevealcontroller

查看:160
本文介绍了在swrevealcontroller之前实现登录屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始学习IOS开发,我已经成功实现了SWRevealViewController,在线跟踪给定的教程都按预期工作。

I've just started learning IOS development, I've successfully implemented the SWRevealViewController by following a given tutorial online all is working as expected.

我已经决定添加一个登录屏幕,这将是用户在运行应用程序时看到的第一个页面。我采取的步骤如下:

I've then decided to add a login screen, which would be the first page the user see's when the application is run. The steps I took are a follows:


  1. 将UIViewController放到故事板上

  2. 设置此项正如我的'是初始视图控制器'

  3. 为此新视图添加了一个按钮,并为测试目的创建了一个seque

但是当我点击这个按钮它什么也没做的时候,所以在搜索网页并试图自己想出这个之后不幸的是,由于我对此缺乏了解,我没有成功,有人会很友好给我一些关于我需要改变什么的指示,或者我需要修改哪些部分以使这个流程按预期工作?

But when I click this button it does nothing, so after searching the web and trying to figure this one by my self unfortunately I've been unsuccessful due to my lack of knowledge on this, would someone be kind enough to give me some pointers on what I need to change if anything, or what sections need to me modified to make this flow work as expected?

下面是一个屏幕抓取我目前的故事板。

Below is a screen grab of my current story board.

更新

添加相关代码后,应用委托代表fi我仍然收到此错误消息:

After adding the relevant code the app delegate file I still receieve this error message:

推荐答案

步骤1

将您的登录VC嵌入到NavigationController。

embed your login VC to NavigationController.

步骤2

将segue类型设置为模态并调用

on your login button action set the segue type as Modal and call as

 @IBAction func btnLogin(sender: AnyObject) {

    self.performSegueWithIdentifier("openSWL", sender: self)
  }

对于流程理解目的

对于示例项目,您可以在这里下载

For sample Project you can download here

这篇关于在swrevealcontroller之前实现登录屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆