Repository navigation
Fix content insets when automaticallyAdjustsScrollViewInsets is set to NO - #420
Conversation
d12eab5 to
e45a10d
Compare
julianrex
left a comment
There was a problem hiding this comment.
Just some confusion with naming here on my part. Any chance of consolidating here?
| [constraints addObjectsFromArray:updatedConstraints]; | ||
| } | ||
|
|
||
| - (BOOL)hasAutomaticallyAdjustContentInset { |
There was a problem hiding this comment.
nit: I'm having trouble understanding the meaning of the method name.
Can we match the similar view controller method? automaticallyAdjustsContentInsets
depending on context?
EDIT: Oh, I see - (BOOL)automaticallyAdjustsContentInset - I'm more confused now 😕
There was a problem hiding this comment.
hasAutomaticallyAdjustContentInset is an internal convenience method to avoid code duplication. Since we have two ways to check if we disabled adjusting automatically content insets: using UIViewController.automaticallyAdjustsScrollViewInsets (deprecated) and MGLMapView.automaticallyAdjustContentInset I am using this method to check these options.
| - (NSLayoutYAxisAnchor *)safeTopAnchor { | ||
| if ([self hasAutomaticallyAdjustContentInset]) { | ||
| return self.mgl_safeTopAnchor; | ||
| } else { | ||
| return self.topAnchor; | ||
| } | ||
| } |
There was a problem hiding this comment.
Another confusing one for me - is there anyway to combine safeTapAnchor and mgl_safeTopAnchor?
There was a problem hiding this comment.
What this method is doing is check if it has automatically adjust content insets. If it has then it uses an anchor that considers safe areas which is self.mgl_safeTopAnchor that is in a category, if it is not then uses the current view anchor without considering safe areas.
* master: Fix content insets when automaticallyAdjustsScrollViewInsets is set to NO (#420)
…o NO (#420) * Fix an issue when automaticallyAdjustContentInset is set to NO * Update tests to account for safe areas on iOS 11 * Update changelog * Update method documentation
* changing the default size for approx ring border when zoomed out (#429) * Approximate Location "Puck" logic updates (#427) * updates to approximate puck drawing logic * removing unused header * Allow for transitive dependencies (#431) * Fix content insets when automaticallyAdjustsScrollViewInsets is set to NO (#420) * Fix an issue when automaticallyAdjustContentInset is set to NO * Update tests to account for safe areas on iOS 11 * Update changelog * Update method documentation * Update to gl-native 5.0.0 (#438) * Update to application state management and associated view setup and rendering (#432) Co-authored-by: Neel Mistry <[email protected]> Co-authored-by: Fredrik Karlsson <[email protected]> Co-authored-by: Julian Rex <[email protected]>
Fixes #167