如何为SWRevealViewController立即调用Selector?

时间:2014-09-17 08:50:13

标签: ios swift swrevealviewcontroller

SWRevealViewController来电revealToggle:(菜单)需要:

someButton.addTarget(self.revealViewController(), action: Selector("revealToggle:"), forControlEvents: UIControlEvents.TouchUpInside)
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
self.view.addGestureRecognizer(self.revealViewController().tapGestureRecognizer())

但是只有按下按钮(TouchUpInside)才能正常工作。我该怎么称呼它?显示viewDidLoad时只需view

1 个答案:

答案 0 :(得分:1)

self.revealViewController.revealToggle()