首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >入职/演练AutoLoad

入职/演练AutoLoad
EN

Stack Overflow用户
提问于 2015-09-08 08:32:31
回答 1查看 276关注 0票数 2

我是swift和xcode的新手,我想知道是否有人可以帮助我解决我面临的一个问题……如何让情节提要自动加载,而不是按下按钮启动?

这里有一个很好的例子:https://github.com/ariok/BWWalkthrough

在这个例子中,以及在网上找到的其他例子中,总是有一个按钮需要按下,但在我正在开发的应用程序中,我希望自动加载第一个屏幕,并有一个跳过/继续按钮。

这是按钮的代码:

代码语言:javascript
复制
@IBAction func playWalkthrough() {
    // Get view controllers and build the walkthrough

    let stb = UIStoryboard(name: "Walkthrough", bundle: nil)
    let walkthrough = stb.instantiateViewControllerWithIdentifier("walk") as! BWWalkthroughViewController
    let page_zero = stb.instantiateViewControllerWithIdentifier("walk0") as! UIViewController
    let page_one = stb.instantiateViewControllerWithIdentifier("walk1") as! UIViewController
    let page_two = stb.instantiateViewControllerWithIdentifier("walk2")as! UIViewController
    let page_three = stb.instantiateViewControllerWithIdentifier("walk3") as! UIViewController

    // Attach the pages to the master
    walkthrough.delegate = self
    walkthrough.addViewController(page_one)
    walkthrough.addViewController(page_two)
    walkthrough.addViewController(page_three)
    walkthrough.addViewController(page_zero)

    self.presentViewController(walkthrough, animated: true, completion: nil)
}

干杯,罗伯

EN

回答 1

Stack Overflow用户

发布于 2015-09-08 08:54:34

单击故事板中的viewController,转到属性检查器并将is Initial View Controller设置为true。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32447596

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档