【发布时间】:2017-03-23 02:11:08
【问题描述】:
我只是实现了 this tutorial 直到 8:35 分钟,但它没有工作。
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.
}}
但是,值得注意的是。我在启动屏幕页面后进入此页面。下面是如何做到的
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 Navigate。
我进入页面,打开按钮..但是当我点击它时没有正确的显示控制器打开。
【问题讨论】:
-
我正在尝试实例化ViewController(withidentifier: "SWRevealViewController" 出现黑屏
标签: ios swift swrevealviewcontroller