You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[yes] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
[yes] My issue is reproducible in the demo project.
Describe the bug
App goes to background/when we try to open an external link and then when we come back to our app, the app transits to landscape in iPad.
To Reproduce
Create an option under Push View Controller of Left Menu that takes to an external link. Click on the above option. Come back to Side Menu app.
Expected behavior
Side Menu does not transit to landscape in iPhone and behaves as expected. However, it transits in iPad.
@jonkykong
On steps to reproduce : you've got to click "Open link" that opens google in safari and then come back to the application. May be trying it multiple times you could reproduce it. Also, please try as I did in the video attached.
iOS Version : 13.7 iPad(7th generation).
Thanks.
@2h4u Adding the inactive case to your fix I was able to fix the weird transition when rotates the device in background too. I just left a comment in the PR #650 with the code.
Can someone please give me clear repro steps, even if it's not consistent? I want to understand the problem better before I take anymore changes to this issue. @DiegoArenaO the main fix seems to be checking for the app's inactive state -- I'd prefer to keep the changes around the forced unwraps out and the fatal errors aren't very actionable for a developer to troubleshoot their own code since it's deep within SideMenu's code.
Can someone please give me clear repro steps, even if it's not consistent? I want to understand the problem better before I take anymore changes to this issue.
Which information is my post (#656 (comment)) missing to make it a clear step-by-step guide for you?
@DiegoArenaO the main fix seems to be checking for the app's inactive state -- I'd prefer to keep the changes around the forced unwraps out and the fatal errors aren't very actionable for a developer to troubleshoot their own code since it's deep within SideMenu's code.
The fatalError() calls fulfill more of a documentary purpose. And if everything behaves as indented the devs which use the SideMenu lib should never notice them because there should always be a non-nil presentationController within the SideMenuAnimationController if a method like SideMenuAnimationController.transitionWillBegin() is called. The benefit of this is that everybody that takes a look at the code of SideMenu immediately knows that presentationController should not be nil at this point.
Maybe there should be also some documentation which describes why presentationController needs to be present and what happens if it is not.
The main problem with the current implementation is that it says that presentationController == nil is a valid state, which it is clearly not. So it is better that there is a crash with a descriptive error message than misbehaving code which is very hard to debug. (Here is a quick read for everyone which wonders why this might be a good idea: https://www.martinfowler.com/ieeeSoftware/failFast.pdf)
Hi @jonkykong in my case I was able to reproduce it consistently in my app, the steps are the same of the @2h4u in the first comment but the steps are the following:
1 - Show menu panel
2 - Sent the app to background
3 - Open the app
4 - Open the menu panel
5 - The detail view is rotated 90°
Activity
jonkykong commentedon Oct 21, 2020
I've tried reproducing this using your modified project using iPad Pro (iOS 14) and have not been successful. Please provide the following:
jonkykong commentedon Oct 22, 2020
@kirthika
kirthika commentedon Oct 27, 2020
@jonkykong
On steps to reproduce : you've got to click "Open link" that opens google in safari and then come back to the application. May be trying it multiple times you could reproduce it. Also, please try as I did in the video attached.
iOS Version : 13.7 iPad(7th generation).
Thanks.
2h4u commentedon Oct 27, 2020
I could reproduce the issue as well but it does not happen every time. I need to try the following steps around 5 times to reproduce the issue.
Here is a video that shows how i reproduced the issue with the sample code @kirthika provided.
ScreenRecord.mov.zip
At #648 I posted another video showing the same issue but with my production codebase.
DiegoArenaO commentedon Oct 29, 2020
Hi, I'm experiencing the same issues too in my App.
Did you have any workaround to avoid it?
Thanks
2h4u commentedon Oct 29, 2020
@DegenDao try out my PR i made a while ago and give us feedback if it helps. For me at least it fixed all issues #650
DiegoArenaO commentedon Oct 29, 2020
@2h4u This change fix the issue only if the device is not rotated, but it's a good approach to fix the rotation issue.
Thanks
DiegoArenaO commentedon Oct 29, 2020
@2h4u Adding the inactive case to your fix I was able to fix the weird transition when rotates the device in background too. I just left a comment in the PR #650 with the code.
Thanks.
jonkykong commentedon Nov 2, 2020
Can someone please give me clear repro steps, even if it's not consistent? I want to understand the problem better before I take anymore changes to this issue. @DiegoArenaO the main fix seems to be checking for the app's inactive state -- I'd prefer to keep the changes around the forced unwraps out and the fatal errors aren't very actionable for a developer to troubleshoot their own code since it's deep within SideMenu's code.
2h4u commentedon Nov 3, 2020
Which information is my post (#656 (comment)) missing to make it a clear step-by-step guide for you?
The
fatalError()calls fulfill more of a documentary purpose. And if everything behaves as indented the devs which use the SideMenu lib should never notice them because there should always be a non-nilpresentationControllerwithin theSideMenuAnimationControllerif a method likeSideMenuAnimationController.transitionWillBegin()is called. The benefit of this is that everybody that takes a look at the code of SideMenu immediately knows thatpresentationControllershould not be nil at this point.Maybe there should be also some documentation which describes why
presentationControllerneeds to be present and what happens if it is not.The main problem with the current implementation is that it says that
presentationController == nilis a valid state, which it is clearly not. So it is better that there is a crash with a descriptive error message than misbehaving code which is very hard to debug. (Here is a quick read for everyone which wonders why this might be a good idea: https://www.martinfowler.com/ieeeSoftware/failFast.pdf)DiegoArenaO commentedon Nov 3, 2020
Hi @jonkykong in my case I was able to reproduce it consistently in my app, the steps are the same of the @2h4u in the first comment but the steps are the following:
1 - Show menu panel
2 - Sent the app to background
3 - Open the app
4 - Open the menu panel
5 - The detail view is rotated 90°
kirthika commentedon Nov 3, 2020
@DiegoArenaO that's right.. @jonkykong please try with the same steps..
DiegoArenaO commentedon Dec 3, 2020
Hi @jonkykong Any news with this bug? we are still facing it.