-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Map view should not force its tint color onto subviews #9597
Comments
The attribution button has been opted-out of MGLMapView’s tint updating (#9598), starting in v3.6.1. |
Fixed in #9598 |
#9598 did this for the attribution button, but I think we should do the same for any subview of the map view. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Hey team, sorry for summoning this back but, this is actually causing our whole callout (and subviews) tintColor to be replaced, and looking at the Do you still have plans to remove that? 🙏 Thank you! |
Platform: iOS v3.6.0
Since forever, we’ve been forcefully updating MGLMapView’s subviews to match its tint color. @boundsj’s post in #8522 (comment) contains a great explanation of why and how we’ve done this.
The problem is, it’s not necessary for MGLMapView to handle updating its subviews — UIKit will automatically inform subviews via
-tintColorDidChange
, where that subview can decide for itself whether or not to update with its parent view.Proposal
-[MGLMapView tintColorDidChange]
entirely.-tintColorDidChange
in custom subviews that we want to keep in sync with the map view’s tint — mainly MGLFaux3DUserLocationAnnotationView, perhaps MGLCompactCalloutView.This would be a potentially breaking change for developers who are relying on not having to implement
-tintColorDidChange
themselves, so I’ve tentatively put it on the v3.7.0 milestone.Example
Current result: The attribution button’s custom tint color is lost, as MGLMapView recursively resets its subviews’ tint colors to match itself, triggered by
-tintColorDidChange
.Fixed result: The attribution button’s custom tint color is kept, because it no longer inherits its tint from MGLMapView and we’re not forcing it to change.
/cc @1ec5 @boundsj @fabian-guerra @jmkiley
The text was updated successfully, but these errors were encountered: