我直接執行this tutorial直到分鐘8:35,它不起作用。SWRevealViewController不工作
import Foundation
class ViewController: UIViewController {
@IBOutlet weak var Open: UIBarButtonItem!
override func viewDidLoad() {
super.viewDidLoad()
print("open")
Open.target = self.revealViewController()
Open.action = Selector("revealToggle:")
print("open2")
}
override func viewDidAppear(_ animated: Bool) {
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}}
但是,它的值得注意。我得到這個頁面閃屏page.And以下後我怎麼做
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "Navigate") as! UINavigationController
//self.present(vc, animated: true, completion: nil)
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController = vc
從Splashscontroller我打電話去main.storyboard。 導航,我點擊導航控制器,並給它storyboardid導航。
我打開頁面,打開按鈕..但沒有權利揭示控制器打開時,我點擊它。
我試圖instantiateViewController(withidentifier:「SWRevealViewController」越來越黑屏 –