Instructions
Instructions copied to clipboard
device orientation will change after starting instructions twice (landscape mode apps)
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
Hi @clueth, thanks for reporting the issue. That's weird, I'll have a look.
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?
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.
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
Hi Sylvain, unfortunately I couldn't fix it so far.
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.
Hi @clueth, I'm encountering the same problem on iPad running on Landscape, did you find any solution ?