我试图在按下按钮时禁用视图控制器上的元素,然后在再次按下按钮时重新启用它们。我可以禁用元素,但是重新启用它们不起作用:
if self.revealViewController() != nil {
menuBarButton.target = self.revealViewController()
menuBarButton.action = #selector(SWRevealViewController.revealToggle(_:))
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
self.tbvRestaurant.isUserInteractionEnabled = false
self.searchRestaurant.isUserInteractionEnabled = false
} else {
self.tbvRestaurant.isUserInteractionEnabled = true
self.searchREstaurant.isUserInteractionEnabled = true
}
此外,如果您熟悉SWRevealController,能否告诉我如何切换幻灯片?