Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self.revealViewController().delegate is nil? #14

Closed
Dbigshooter opened this issue Nov 6, 2016 · 1 comment
Closed

self.revealViewController().delegate is nil? #14

Dbigshooter opened this issue Nov 6, 2016 · 1 comment
Assignees
Labels

Comments

@Dbigshooter
Copy link

Dbigshooter commented Nov 6, 2016

Hi there,

In one of my viewControllers I use it with success, however I'm facing a problem in a viewController where I want the leftView to be called from a button. Whenever I try to set the delegate with self.revealViewController().delegate = self it fails at runtime caused by a nil. In my class I basically do this:

class MapViewController: UIViewController, PBRevealViewControllerDelegate {
...
    @IBOutlet weak var menuButton: UIButton!
...
override func viewDidLoad() {
        super.viewDidLoad()
...
        self.revealViewController().delegate = self
...
menuButton.addTarget(self, action: #selector(self.revealLeftView), for: UIControlEvents.touchUpInside)
...
}

The self.revealLeftView basically just call the revealLeftView on the PBRevealViewController. I got my main view set up with pb_main and the menu view with pb_left.

pbrevealview

If I leave out the delegate setting the menu works fine, but I can't customize it. Should I place the delegate in the ViewDidAppear instead?

@iDevelopper iDevelopper added the bug label Nov 7, 2016
@iDevelopper iDevelopper self-assigned this Nov 7, 2016
@iDevelopper
Copy link
Owner

Hi @Dbigshooter , my fault. Fixed and pushed to Github and CocoaPods (version 1.1.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants