Instructions icon indicating copy to clipboard operation
Instructions copied to clipboard

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

Open clueth opened this issue 4 years ago • 7 comments

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 avatar Apr 25 '20 13:04 clueth

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

ephread avatar Apr 28 '20 14:04 ephread

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?

ephread avatar Apr 28 '20 17:04 ephread

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 avatar May 10 '20 08:05 clueth

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

SylvainHocq avatar May 27 '21 09:05 SylvainHocq

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

clueth avatar May 27 '21 09:05 clueth

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.

SylvainHocq avatar May 27 '21 11:05 SylvainHocq

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

yasserosama07 avatar Sep 01 '21 13:09 yasserosama07