-
Notifications
You must be signed in to change notification settings - Fork 1k
traitCollectionDidChange loading indicator #4928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
@@ -73,6 +73,14 @@ class LoadingViewController: UIViewController, BottomSheetContentViewController | |||
]) | |||
activityIndicator.startAnimating() | |||
} | |||
|
|||
#if !canImport(CompositorServices) |
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.
I'm assuming this is to block vision OS? I believe we can now use #if !os(visionOS)
since our minimum Xcode version supports this. Somewhere there was a comment about this that I can't find now. Maybe @davidme-stripe could confirm. Probably a good idea to clean up all of the #if !canImport(CompositorServices)
uses to stop us from accidentally propagating this hack.
@@ -73,6 +73,14 @@ class LoadingViewController: UIViewController, BottomSheetContentViewController | |||
]) | |||
activityIndicator.startAnimating() | |||
} | |||
|
|||
#if !canImport(CompositorServices) | |||
public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { |
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.
FYI looks like this is deprecated after iOS 17 https://developer.apple.com/documentation/uikit/uitraitenvironment/traitcollectiondidchange(_:)
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.
lgtm
Summary
The loading indicator color used to be based off of the system mode (light or dark) instead of the component color, and it wouldn't change its color in response to an appearance change. Now we use traitCollectionDidChange to calculate the correct color and change it when necessary.
Motivation
MOBILESDK-3426
Testing
Before
ScreenRecording_04-04-2025.11-12-05_1.MP4
After
Simulator.Screen.Recording.-.iPhone.16.-.2025-05-22.at.20.34.18.mp4
Changelog
N/A