-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ios] fix orientation when launched in landscape
- Loading branch information
Ryan Willoughby
committed
Aug 13, 2015
1 parent
7226982
commit d33ba13
Showing
1 changed file
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d33ba13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, probably the following doesn't matter at all (as it can be assumed, that the
if
in line 1038 always resolves totrue
, isn't it), but from a programmer's perspective …let's assume, this method (
preferredInterfaceOrientationForPresentation
) comes through to it's "fallback"return UIInterfaceOrientationLandscapeRight;
in line 1042;and as we then also can assume, that
supportedInterfaceOrientations
(line 1045) maybe also gets to it's "fallback" in line 1051 (return UIInterfaceOrientationMaskPortrait;
):these two don't work together, the app will crash with
And, on the other hand: why force the BarcodeScanner to a certain starting orientation at all?
In our fork of the "now official repository" of this plugin, I simply omit
preferredInterfaceOrientationForPresentation
.If BarcodeScanner is allowed to rotate (via
shouldAutorotate
) and the actual device orientation is possible (fromsupportedInterfaceOrientations
*), why not simply let it open in that orientation.*: I also implemented that "fallback" in line 1051 as
return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ? UIInterfaceOrientationMaskAllButUpsideDown : UIInterfaceOrientationMaskAll);
so that all normal standard orientations are possible. This also better fits to the "fallback" of
shouldAutorotate
, which returnsYES
in line 1033.But that maybe should be "made […] configurable", as you suppose in the parent commit.