I have read the guidelines for contributing and I understand:
If you want to dismiss the menu, without an animation (eg: viewControllerForPresentedMenu?.dismiss(animated: false, completion: nil)) the dismissal results in a blackscreen. Is this behavior an oversight, or simply not supported, or is this a bug?
It's easily reproducible with the demo-project if you change the dismissal in handleHideMenuTap to non-animated.
It's not crucial for our usecase, but it did cost me an hour of debugging, so I wanted to ask if this is intended and why it does happen.
btw: great project!
Fixed. 10197c53cfb29208b2e2c983bf193b954955849f
This problem still persists...I am getting a black screen when I do :
dismiss(animated : false)
@iamchingel I just verified this works as expected in the demo project.
I encountered same issue.
I avoided the issue. I set SideMenuManager.menuAnimationDismissDuration to 0.0, and dismiss(animated: true).
// add function to class that YourViewController has SideMenu.
// UIApplication.shared.keyWindow?.rootViewController class is better.
// function that sets menuAnimationDismissDuration from the outside.
func setMenuAnimationDismissDuration(_ duration: Double) {
SideMenuManager.menuAnimationDismissDuration = duration
}
```swift
/// ViewController in SideMenu
DispatchQueue.main.async { [weak self] in
(UIApplication.shared.keyWindow?.rootViewController as? YourViewController)?.setMenuAnimationDismissDuration(0.0)
self?.dismiss(animated: true) {
(UIApplication.shared.keyWindow?.rootViewController as? YourViewController)?.setMenuAnimationDismissDuration(0.35) // 0.35 is default value
}
}
Have the same issue too.
transition.hideMenuStart().hideMenuComplete() not executing if I call dismiss(animated: false).
But if I will correct the source code for this to be called, I still see an artifact on the screen while dismissing without animation.
Can someone please provide a modified demo project that simply illustrates this issue?
@jonkykong I was having a similar problem but figured out why. The reason your demo project works is because you've set the sideMenuDelegate and therefore your "Work-around" here does what you say it should.
For us however (and maybe others), we had no use for these delegate methods and therefore did not set the sideMenuDelegate. Although you say the implementation of the sideMenuDelegate is optional, your work around requires you to set it in order for the fix to do its job. This could be where others are getting tripped up too.
Might be worth adding a note to the README or call transition.hideMenuStart().hideMenuComplete() in a different spot?
This issue should now be resolved in version 6.0.0+ of SideMenu. Please run pod update and reopen this issue if the problem persists.
Most helpful comment
@jonkykong I was having a similar problem but figured out why. The reason your demo project works is because you've set the
sideMenuDelegateand therefore your "Work-around" here does what you say it should.For us however (and maybe others), we had no use for these delegate methods and therefore did not set the
sideMenuDelegate. Although you say the implementation of thesideMenuDelegateis optional, your work around requires you to set it in order for the fix to do its job. This could be where others are getting tripped up too.Might be worth adding a note to the README or call
transition.hideMenuStart().hideMenuComplete()in a different spot?