链接到BWWalkthrough库:https://github.com/ariok/BWWalkthrough
我刚接触iOS开发(SWIFT2.2,Xcode7.3.1)。我已经经历了使用库BWWalkthrough为我的应用程序工作。当演练页(类BWWalkthroughPageViewController)加载时,我希望在每一页上自动播放视频。目前,我可以在演练页面的主序列图像板中使用view scene添加图像、标签、按钮等,但如何向这些页面添加视频?我是否应该为每个页面创建"XViewController.swift“文件,以编程方式添加视频?但是如何将这些文件与演练页链接起来呢?当前,页面添加到漫游中的方式为:
@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“类,我是否应该定义一个新类来以编程方式添加视频?
发布于 2016-08-10 01:36:19
当然,这是唯一的方法,创建一个新的类,如果你喜欢创建一个视图到(例如。故事板)并添加您的视频。我希望对你有用。
OBS:如果你知道如何编辑BWWalkthroughPageViewController的类,你可以创建一个特定的修改来导入视频。
https://stackoverflow.com/questions/38857093
复制相似问题