我有点卡在BWWalkthrough库,我试图在应用程序启动时实现。我有两个故事板Main One和SlidesFlow故事板。我将主界面设置为SlidesFlow,并将初始故事板设置为SlidesFlow。我确实为BWWalkthroughViewController创建了1个视图,为BWWalkthroughPageViewController创建了另外4个视图。在我在didFinishLaunchingWithOptions功能的AppDelegate我用下面的代码:使BWWalkthrough库在启动时开始
private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
// Get view controllers and build the walkthrough
let stb = UIStoryboard(name: "SlidesFlow", bundle: nil)
let walkthrough = stb.instantiateViewController(withIdentifier: "SlideShow") as! BWWalkthroughViewController
let page_zero = stb.instantiateViewController(withIdentifier: "Slide_1")
let page_one = stb.instantiateViewController(withIdentifier: "Slide_2")
let page_two = stb.instantiateViewController(withIdentifier: "Slide_3")
let page_three = stb.instantiateViewController(withIdentifier: "Slide_4")
// 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)
return true
}
不应该工作的呢?我错过了什么吗?
分配'window.rootViewController = walkthrough'前'返回TRUE' –
它仍然无法正常工作。 – Netra
检查所有viewContoller是否已初始化,或者演练是否不为零。 –