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

device orientation will change after starting instructions twice (landscape mode apps) #235

Open
clueth opened this issue Apr 25, 2020 · 7 comments

Comments

@clueth
Copy link

clueth commented Apr 25, 2020

Describe the bug
I have an app which runs only in landscape mode (iPhone & iPad). When the user starts the instructions by tapping a button everything works fine. But if he skips the tutorial and starts it the second time, the orientation of the instructions change to portrait mode which will crash the cutout paths and the orientation of the coamarks.

To Reproduce

Start instructions twice in landscape mode

Expected behavior

The orientation should always be the same as the selected one of the device

Screenshots

Environment:

  • Device:
    all iPhones & iPads
  • iOS version:
    iOS 11 - 13 (I could not test older versions, but I think the bug exists on each operating system)
  • Instructions version:
    1.4.0
  • Dependency Manager:
    CocoaPods

Additional context

@clueth clueth changed the title devive orientation will change after starting instructions twice device orientation will change after starting instructions twice Apr 25, 2020
@clueth clueth changed the title device orientation will change after starting instructions twice device orientation will change after starting instructions twice (landscape mode apps) Apr 25, 2020
@ephread
Copy link
Owner

ephread commented Apr 28, 2020

Hi @clueth, thanks for reporting the issue. That's weird, I'll have a look.

@ephread
Copy link
Owner

ephread commented Apr 28, 2020

I have trouble reproducing the issue. With the example project, starting the flow twice in landscape works fine. Would you be able to provide a sample project demonstrating the problem?

@clueth
Copy link
Author

clueth commented May 10, 2020

Hi @ephread,
thank you. That suggests that it's the specific call within my app. I'm gonna analyze this again. I will close the issue in the meantime.

@clueth clueth closed this as completed May 10, 2020
@SylvainHocq
Copy link

Hi @clueth , have you fix your problem? How?
I have the same problem, the instructions change to portrait mode the second time.
Thank you in advance for your reply

@clueth
Copy link
Author

clueth commented May 27, 2021

Hi Sylvain,
unfortunately I couldn't fix it so far.

@clueth clueth reopened this May 27, 2021
@SylvainHocq
Copy link

SylvainHocq commented May 27, 2021

Hi @clueth
In fact, i have founded my bug.
I do this kind of things to not recreate already existing instance of CoachMarksController:

func displayTutorial() {
        if coachMarksController == nil {
            let coachMarksContr = CoachMarksController()
            coachMarksController = coachMarksContr
            coachMarksContr.dataSource = self
            coachMarksContr.delegate = self
            coachMarksContr.interfaceOrientations = .userDefined(as: .all)
        }
        coachMarksController?.start(in: .window(over: self))
    }

But the if coachMarksController == nil { was not a good idea.
Remove the if, fix my bug.
May be you have done the same error.

@yasserosama07
Copy link

Hi @clueth, I'm encountering the same problem on iPad running on Landscape,
did you find any solution ?

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

No branches or pull requests

4 participants