How to tell Smart Invert in iOS 11 not to invert my app colors and detect if it is enabled?
iOS 11 has a new feature called “Smart Invert Colors”, and I want to take advantage of that in my app. I already have my own dark mode implemented in my app, so I’ll do the “color inversion” process myself when Smart Invert is enabled. What I want to know is:
- How do I tell iOS 11 that the app has a dark interface and don’t invert colours, similar to the iOS Clock app in iOS 10+?
- How do I detect which kind of Invert Colors, specifically “Smart Invert” or “Classic Invert”, is enabled?
I’ve searched everywhere at Google, StackOverflow, and Apple Developer Website for some time now and still couldn’t find the answer.
Thanks in advance!
Thanks to @Toma’s answer, I successfully managed to prevent iOS 11 from inverting views in my app. Now I have another problem…
For the detection part, it appears that
UIAccessibilityIsInvertColorsEnabled() will only return
true if Smart Invert is on (iOS 11). At least it’s enough for me, for now. I’m now wondering how to find out when Classic Invert is on. Post an updated answer below if you know how to do so! Thanks!
- Change the color or texture of a SCNText node object (Swift - Scenekit)
- Changing the mouse's i-beam cursor in Xcode 4
- Adding Colours (Colors) Together like Paint (Blue + Yellow = Green, etc)
- Want to change a particular color inside an image with another color - iPhone
- tableview image content selection color
- How To Change Tab bar color in Xcode
Solutions Collect From Internet About “How to tell Smart Invert in iOS 11 not to invert my app colors and detect if it is enabled?”
See iOS 11
UIView‘s property accessibilityIgnoresInvertColors.
- OpenSSL RSA_public_encrypt strange behavior
- Thread safety of UIImage
- Get Location Updates for iOS App Even when Suspended
- iOS Core Plot CPTAxisLabel alignment to CPTPlot
- Activity indicator should be displayed when navigating from UITableView1 to UITableView2
- Setting layoutMargins of UIView doesn't work
- How to detect the location of my finger through in a scrollview or webview in Swift? (using touchesMoved if possible)
- Xcode : Adding a project as a build dependency
- Connect UITableView DataSource/Delegate to base UIViewController class
- How do I convert swift Dictionary to NSDictionary
- iPhone Get UIImagePickerController Lat/Lng
- shouldAutorotate behavior in iOS 8
- Dateformatter gives wrong time on conversation
- Adding a day to current date in iOS
- How can I use Core Graphics to draw a circle at my touch location?