I am working on a creating a sidebar menu using SWRevealViewController in Swift. Trouble is I get the following error: 'PrincipalViewController' does not have a member named 'revealViewController'
The code I am working on is:
class PrincipalViewController: UIViewController {
@IBOutlet weak var menuButton:UIBarButtonItem!
override func viewDidLoad() {
super.viewDidLoad()
// This is the line with the error
if self.revealViewController() != nil {
menuButton.target = self.revealViewController()
menuButton.action = "revealToggle:"
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
// Uncomment to change the width of menu
//self.revealViewController().rearViewRevealWidth = 62
}
}
Any ideas? Thanks a lot
self.revealViewController()
? – Memphian