在应用程序启动时显示登录屏幕 [英] Present login screen on app startup

查看:189
本文介绍了在应用程序启动时显示登录屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我以前的 UIView动画问题中,我提到我必须模拟一些视图的模态行为。在这里,我将解释为什么并提出一些更好的解决方案。

In my previous question on UIView animations I mentioned that I have to simulate the modal behavior for some view. Here I'll explain why and ask about some better solution.

用户应该在我的应用程序中看到的第一个视图是登录屏幕。验证成功后,该程序会检查用户是否是父母或子女(在家庭中)。对于每个这些角色,应用程序必须提供不同的功能。

The first view a user should see in my app is the login screen. Upon successful authentication the program checks if the user is a parent or a child (in a family). For each of these roles the app must provide different functionality.

所以我设计了这样的应用程序:

So I designed the app like this:


  • 在AppDelegate中为登录视图控制器和标签栏控制器(用于界面的主要部分)声明出口。

  • application:didFinishLaunchingWithOptions:方法

    • 将主窗口的 rootViewController 设置为登录查看控制器。

    • 让AppDelegate登录控制器的委托,所以在完成工作后可以发送通知。

    • Declare outlets for the login view controller and a tab bar controller (for the main part of the interface) in my AppDelegate.
    • In the application:didFinishLaunchingWithOptions: method
      • Set the rootViewController of the main window to the login view controller.
      • Make AppDelegate the delegate for the login controller, so it can send notification when it's done its job.

      我想提出和关闭登录屏幕,就像它是一个模态视图,但AppDelegate只有一个裸露的窗口,因此我没有一个对象发送 presentModalViewController: / code>到。这带来了一个问题:

      I would like to present and dismiss the login screen as if it is a modal view, but AppDelegate only has a bare window, thus I don't have an object to send presentModalViewController: to. This brings up a question:

      首先,这是一个很好的设计吗?

      如果是,如何模拟一个模态行为正确?

      推荐答案

      Hii,

      你应该参考这个

      http:// code.google.com/p/tweetero/

      https://github.com/jbrien/WordPress-iPhone

      希望这有帮助!

      这篇关于在应用程序启动时显示登录屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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