This repository was 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
Revert KVO triggered manual layout of map ornaments #9995
Merged
boundsj
merged 3 commits into
release-ios-v3.6.0-android-v5.1.0
from
boundsj-revert-manual-ornament-layout
Sep 14, 2017
Merged
Revert KVO triggered manual layout of map ornaments #9995
boundsj
merged 3 commits into
release-ios-v3.6.0-android-v5.1.0
from
boundsj-revert-manual-ornament-layout
Sep 14, 2017
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
frederoni
reviewed
Sep 14, 2017
UIViewController *viewController = self.viewControllerForLayoutGuides; | ||
|
||
if (_isObservingTopLayoutGuide) { | ||
[(NSObject *)viewController.topLayoutGuide removeObserver:self forKeyPath:@"bounds" context:(void *)&MGLLayoutGuidesUpdatedContext]; |
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.
Nit: MGLLayoutGuidesUpdatedContext
can be removed.
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.
🙇 fixed in 0a19195
friedbunny
approved these changes
Sep 14, 2017
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.
This reverts the manual layout triggered by KVO approach in favor of a constraints based approach that the KVO method had previously replaced. Although the manual layout approach worked well in most cases and was cleaner in that it did not manipulate any containing views in the app space, using KVO on UIViewControllers has proven to be dangerous. This also updates the gitshas for KIF and OHHTTPStubs to unbreak UI tests that verify these related changes are working.
2c757c7
to
611e6ce
Compare
Most checks are failing now when trying to download dependencies from s3 (which is currently having major issues). I'll try again later. |
0a19195
to
8433723
Compare
mappy-mobile
pushed a commit
to Mappy/mapbox-gl-native
that referenced
this pull request
Oct 3, 2017
….1.4 * release-ios-v3.6.0-android-v5.1.0: (36 commits) [android] [auto] Update properties to version 5.1.4 in preparation for build. [android] - latLngBounds test [android] - update changelog for 5.1.4 release. bump MAS version number to 2.2.3 (mapbox#9901) [android] fix is download complete (a download is complete when count and required resources match and the download state is inactive) (mapbox#9913) [android] - avoid adding duplicate points to bounds [android] Clear out mapCallback's OnMapReadyCallbacks on onDestroy [android] - harden offline region deletion Do not check connection if it is local request [android] - disable rotation gesture when pinch zooming macos-v0.5.1 [ios] Bump podspec to 3.6.4 (mapbox#10059) [android, ios, macos] Updated translations [core] make sure tiles are not treated as complete until all worker operations completed [core] keep tiles renderable even if a subsequent error occurs [ios] Be sure to get a BOOL value for nullable dict keys iosv3.6.3 podspec bump (mapbox#10008) [ios, macos] Deprecate trafficDayStyleURL and trafficNightStyleURL (mapbox#9918) [ios] Use constraints to manage ornament view placement (again) (mapbox#9995) [ios] Canned spam coming from Transifex ... # Conflicts: # platform/android/MapboxGLAndroidSDK/proguard-rules.pro # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
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.
Fixes #9941
This essentially reverts #7716 in favor of a constraint system for laying out MGLMapViews's ornamental views that is very similar to the one originally implemented in #1328 that fixed #1327
It attempts to mix in the things we learned along the way in:
#3697
#6776
#6954
#7084
This includes respecting content insets when the constraints are created.
While I was there, I went ahead and added 2c757c7 that uses iOS 11's new Safe Guide instead of top and bottom layout guides and the layout anchor constraint APIs instead of
+[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]
. This simplifies the layout code a lot. Pre-iOS 11 logic has been pulled into-[MGLMapView updateConstraintsPreiOS11]
and can be deleted -- someday!I updated KIF and OHHTTPStubs to resurrect the UI tests in my environment for Swift 3. Using Xcode 8.3.3 and an iOS 10 simulator, this PR passes the following UI tests in
MapViewTests
:I was unable to run tests using Xcode 9 (beta/GM) and iOS 11 although I did manually verify that the iOS 11 style constraint system works using an iOS 11 (GM) device and that the fallback to to pre-iOS 11 constraints works as expected if the SDK is compiled with Xcode 9 (iOS 11 SDK) and run on a pre-iOS 11 phone.