You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the pre-defined AccentColor color in the Asset Catalog of my app, and I've struggled a bit applying it to the SafariView.
I initially tried this, which I'm using in a few places in my app:
.preferredControlAccentColor(.accentColor)
Unfortunately, this resulted iOS' default blue accent color being used. I guess SFSafariViewController lives in its own context that ignores the accent color?
I then tried loading the AccentColor from the Asset Catalog like this:
Hey,
I'm using the pre-defined
AccentColor
color in the Asset Catalog of my app, and I've struggled a bit applying it to theSafariView
.I initially tried this, which I'm using in a few places in my app:
Unfortunately, this resulted iOS' default blue accent color being used. I guess SFSafariViewController lives in its own context that ignores the accent color?
I then tried loading the
AccentColor
from the Asset Catalog like this:This worked fine in light mode, but failed in dark mode: The light mode color was used in both scenarios.
I finally got it to work by switching back to the deprecated method, setting the UIColor directly:
This works - it appears converting from Color to UIColor loses a lot of information!
I'm not sure if there's a good way to solve this, but it might be worth putting this into the README.md.
The text was updated successfully, but these errors were encountered: