Is there a way to detect if the iPhone is in inver

2019-04-09 04:29发布

问题:

You know how in accessibility, the user can set the home button to triple-click and make that the "inverse color mode"? Is there a way for your app to detect if the phone is in the inverse color mode? Thanks.

回答1:

Yes, and it's simple. You can call

UIAccessibilityIsInvertColorsEnabled();

which return a BOOL for whether or not inverted colors is currently on.

You can also observe

UIAccessibilityInvertColorsStatusDidChangeNotification

to get notified when the user turns on or off inverted colors.