I am growing a CarPlay app and have to accurately deal with model adjustments, notably the excellence between Darkish Mode for the UI and the map’s look. I am utilizing [CPSessionConfigurationDelegate.contentStyleChanged](https://developer.apple.com/documentation/carplay/cpsessionconfigurationdelegate/sessionconfiguration(_:contentstylechanged:))
and [CPTemplateApplicationSceneDelegate.contentStyleDidChange](https://developer.apple.com/documentation/carplay/cptemplateapplicationscenedelegate/contentstyledidchange(_:))
to trace these adjustments, which works properly generally.
Nonetheless, I’ve encountered an edge case:
- Settings: Look -> At all times Darkish
- Settings: Maps -> At all times Present Darkish Map -> OFF
On this situation, each contentStyleChanged
and contentStyleDidChange
report a .mild
content material model. That is incorrect as a result of whereas the map ought to be displayed in mild mode (because of the “At all times Present Darkish Map” setting), the UI ought to nonetheless be in darkish mode because of the “At all times Darkish” setting in Look.
My aim is to copy the habits of Apple Maps and Google Maps, which accurately show a light-weight map with a darkish UI on this particular situation. How can I reliably decide the supposed UI model (darkish on this case) unbiased of the map model override?
Picture from Google maps as a reference:
Here is what I’ve tried to date:
- Utilizing
CPSessionConfigurationDelegate.contentStyleChanged
andCPTemplateApplicationSceneDelegate.contentStyleDidChange
. These strategies present the ensuing model after the map override, not the supposed UI model.
Is there a option to entry the underlying “Look” setting (Automated/At all times Darkish) individually from the “At all times Present Darkish Map” setting? Or is there one other method to accurately differentiate between the supposed UI model and the map’s look in CarPlay?
Any assist or pointers in the fitting route could be drastically appreciated!