首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用BWWalkthrough在演练页面中自动播放视频

如何使用BWWalkthrough在演练页面中自动播放视频
EN

Stack Overflow用户
提问于 2016-08-10 01:30:48
回答 1查看 98关注 0票数 1

链接到BWWalkthrough库:https://github.com/ariok/BWWalkthrough

我刚接触iOS开发(SWIFT2.2,Xcode7.3.1)。我已经经历了使用库BWWalkthrough为我的应用程序工作。当演练页(类BWWalkthroughPageViewController)加载时,我希望在每一页上自动播放视频。目前,我可以在演练页面的主序列图像板中使用view scene添加图像、标签、按钮等,但如何向这些页面添加视频?我是否应该为每个页面创建"XViewController.swift“文件,以编程方式添加视频?但是如何将这些文件与演练页链接起来呢?当前,页面添加到漫游中的方式为:

代码语言:javascript
复制
@IBAction func openInstrButtonPressed(){

    let stb = UIStoryboard(name: "Main", bundle: nil)
    walkthrough = stb.instantiateViewControllerWithIdentifier("container") as! BWWalkthroughViewController
    let page_one = stb.instantiateViewControllerWithIdentifier("instr_page1")
    let page_two = stb.instantiateViewControllerWithIdentifier("instr_page2")
    let page_three = stb.instantiateViewControllerWithIdentifier("instr_page3")
    let page_four = stb.instantiateViewControllerWithIdentifier("instr_page4")

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

    self.presentViewController(walkthrough, animated: true) {
        ()->() in
        self.needWalkthrough = false
    }
}

由于演练页使用的是"BWWalkthroughPageViewController“类,我是否应该定义一个新类来以编程方式添加视频?

EN

回答 1

Stack Overflow用户

发布于 2016-08-10 01:36:19

当然,这是唯一的方法,创建一个新的类,如果你喜欢创建一个视图到(例如。故事板)并添加您的视频。我希望对你有用。

OBS:如果你知道如何编辑BWWalkthroughPageViewController的类,你可以创建一个特定的修改来导入视频。

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

https://stackoverflow.com/questions/38857093

复制
相关文章

相似问题

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