This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Check supported interface orientations into account when rotating device/view layout #13900
Merged
Conversation
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
julianrex
added
bug
iOS
Mapbox Maps SDK for iOS
⚠️ DO NOT MERGE
Work in progress, proof of concept, or on hold
labels
Feb 8, 2019
@friedbunny thoughts? |
friedbunny
reviewed
Feb 8, 2019
julianrex
added
needs changelog
Indicates PR needs a changelog entry prior to merging.
and removed
⚠️ DO NOT MERGE
Work in progress, proof of concept, or on hold
labels
Feb 11, 2019
friedbunny
approved these changes
Feb 12, 2019
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.
LGTM, besides the changelog.
platform/ios/src/MGLMapView.mm
Outdated
// at the owning view controller (in cases where the map view may be covered | ||
// by another view. | ||
|
||
// UIViewController *viewController = [self viewControllerForLayoutGuides]; |
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.
Should we get rid of this line?
julianrex
removed
the
needs changelog
Indicates PR needs a changelog entry prior to merging.
label
Feb 12, 2019
julianrex
force-pushed
the
jrex/layoutsubviews-device-rotation
branch
from
February 12, 2019 03:38
0396de6
to
9b9b38c
Compare
As a follow-up, we're investigating whether we even need |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #13895
Since we don't provide a view controller or hooks for
-[UIViewController viewWillTransitionToSize:withTransitionCoordinator:]
we call[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]
to detect device rotation.However, we do not currently take into account the application's (and view controller's) supported interface orientations. And as such,
layoutSubviews
is called on each device rotation (even if the UI doesn't change).This
experimentalbranch/PR adds those checks:From the Apple documentation for
UIViewController.supportedInterfaceOrientations
:This PR checks the top-most view controller's
shouldAutorotate
...... and also checks that view controller's
supportedInterfaceOrientations
intersected with the orientations provided by the application (as noted above).Note: this PR checks the top-most view controller rather than the view controller that hosts the map view.