【发布时间】:2016-05-17 00:31:06
【问题描述】:
我是使用 Swift 编程的新手。我想知道如何从头开始创建一个应用程序(从一开始就没有启动屏幕,没有第一页,也没有故事板)——我删除了我所有的 ViewController 及其相关的故事板以及启动屏幕。我设法让启动画面正常工作,但我无法让它过渡到第一页(目前也存在)。
我做过的事情: 创建了新的故事板,其中包含主页的视图控制器和扩展 UIViewController 的关联 swift 文件。也将两者联系起来。
但我无法让 lauchscreen 转换到主页。对此的任何帮助将不胜感激。我也尝试与其他 Swift 项目进行比较,但我不知道如何进行。
编辑:
import UIKit
class MyViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
这是我的主页视图控制器。我的故事板非常基础,其中没有 ui 元素,只是一个视图控制器。 @nobre 已经回答了这个问题。
【问题讨论】:
-
取决于您如何过渡到 LaunchScreen,您能否为您的问题添加更多信息,例如您编写的代码?
标签: ios swift uiviewcontroller