Pulley icon indicating copy to clipboard operation
Pulley copied to clipboard

supportedDrawerPositions not working

Open MichaelJBerk opened this issue 6 years ago • 4 comments

I have a project that's based on the demo. However, when I try to set the supportedDrawerPositions like this:

 func supportedDrawerPositions() -> [PulleyPosition] {`
        return [.open]`
}

it doesn't do anything. I've also tried running setNeedsSupportedDrawerPositionsUpdate on ViewWillAppear, but it still doesn't change anything. All the above code is in the drawerViewController. I have also tried taking the demo and just setting supportedDrawerPositions, and it that works fine.

MichaelJBerk avatar Jul 19 '19 19:07 MichaelJBerk

Is your delegate method being called if you set a breakpoint? If it’s not, it’s possible that a different VC is actually taking the role of this delegate.

This occurs if you’re using a parent view controller such as a navigation controller, tabbar controller, etc. In those cases, the parent VC is the delegate.

amyleecodes avatar Jul 19 '19 19:07 amyleecodes

It's not triggering the breakpoint. The drawer does have a navigation controller in it, so that might be what's causing the issue

MichaelJBerk avatar Jul 19 '19 19:07 MichaelJBerk

That’s the issue. In that case, the navigation controller is the delegate. You’ll need to subclass it and implement methods there.

amyleecodes avatar Jul 19 '19 19:07 amyleecodes

Thank you!

MichaelJBerk avatar Jul 19 '19 20:07 MichaelJBerk