I'm trying to listen for changes on the Prefers Cross-Fade Transitions accessibility option using UIKit in Objective-C but for some reason UIAccessibilityPrefersCrossFadeTransitionsStatusDidChangeNotification
does not get triggered when I toggle this option in the accessibility settings, I've tested both using the simulator and a real device running iOS 15.2
According to the docs this should be fine https://developer.apple.com/documentation/uikit/uiaccessibilitypreferscrossfadetransitionsstatusdidchangenotification?language=objc
Here is a little snapshot of the code I'm using
- (void)prefersCrossFadeTransitionsStatusDidChange:(__unused NSNotification *)notification
{
NSLog(@"Prefers Cross-Fade Transitions changed");
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(prefersCrossFadeTransitionsStatusDidChange:)
name:UIAccessibilityPrefersCrossFadeTransitionsStatusDidChangeNotification
object:nil];
Wirdly enough UIAccessibilityPrefersCrossFadeTransitions
returns the correct value when called
I've also tested this using Swift and it does not work either.
prefersCrossFadeTransitionsStatusChanged
is never triggeredNotificationCenter.default.addObserver(self, selector: #selector(prefersCrossFadeTransitionsStatusChanged(_:)), name: UIAccessibility.prefersCrossFadeTransitionsStatusDidChange, object: nil) @objc func prefersCrossFadeTransitionsStatusChanged(_ notif: NSNotification) { print("prefers Cross Fade Transitions Status Changed") }