嗨所以我目前使用這裏的板載庫是一個鏈接,如果你不知道它https://github.com/mamaral/Onboard建立一個視圖控制器,板載
的問題是,我想在我的視圖控制器使用此而不是在應用程序委託中,如示例所示,這是使用以下代碼來設置視圖控制器。
self.window.rootViewController = self.generateSecondDemoVC()
,但我似乎無法做到這一點在我的視圖控制器由於對此沒有選擇,它沒有編制,我怎麼能設置視圖控制器,它返回OnboardingViewController的方法?
這裏是我的視圖控制器文件
//
// PurchaseViewController.swift
// News Cartel
//
// Created by Tunde Adegoroye on 13/12/2015.
// Copyright © 2015 Tunde Adegoroye. All rights reserved.
//
import UIKit
import Onboard
class PurchaseViewController: OnboardingViewController {
@IBAction func closeButtonDidTouch(sender: AnyObject) {
dismissViewControllerAnimated(true, completion: nil)
}
func loadFromNewFilters(notification: NSNotification){
}
override func viewDidAppear(animated: Bool) {
// Can't seem to hook it upto the viewcontroller here
generatePurchasePaging()
}
func generatePurchasePaging() -> OnboardingViewController {
let welcomePage = OnboardingContentViewController(title: "PAY WHAT YOU WANT", body: "I made my app so you could have the best experience reading tech related news. That’s why I want you to value it based on your satisfaction.", image: UIImage(named: "Purchase-Pig"), buttonText: "") {() -> Void in
}
let firstPurchasePage = OnboardingContentViewController(title: "MINT", body: "The app is great but there’s still a few places in room of improvement. If this is your feeling this is for you.", image: UIImage(named: "Purchase-Mint"), buttonText: "69p") {() -> Void in
}
let secondPurchasePage = OnboardingContentViewController(title: "SWEET", body: "IThis is the suggested price where you value the time I spent on development and design. Feel free to pay more or less.", image: UIImage(named: "Purchase-Lolly"), buttonText: "£1.49") {() -> Void in
}
let thirdPurchasePage = OnboardingContentViewController(title: "GOLD", body: "Hello is it me your looking for, if this popped into your mind using the app then this is the price for you.", image: UIImage(named: "Purchase-Gold"), buttonText: "£2.99") {() -> Void in
}
let purchaseVC = OnboardingViewController(backgroundImage: nil, contents: [welcomePage, firstPurchasePage, secondPurchasePage, thirdPurchasePage])
return purchaseVC
}
}
拯救了我的生命,他們確實有一份糟糕的文檔 –
這是否仍適用於您?在我的情況下,它確實添加了它,但是隨後的登錄無法使用 –