iOS 11 brings new feature: Smart Invert. You can define what view’s colors can be inverted.
First image shows normal rendering. On second image is Classic Invert. And third screen is in Smart Invert.
class ViewController: UIViewController {
// MARK: - UI
@IBOutlet fileprivate weak var label: UILabel!
@IBOutlet fileprivate weak var customColorLabel: UILabel!
@IBOutlet fileprivate weak var button: UIButton!
@IBOutlet fileprivate weak var image: UIImageView!
@IBOutlet fileprivate weak var rectangle: UIView!
// MARK: - Life cycle
override func viewDidLoad() {
super.viewDidLoad()
customColorLabel.accessibilityIgnoresInvertColors = true
button.accessibilityIgnoresInvertColors = true
image.accessibilityIgnoresInvertColors = true
rectangle.accessibilityIgnoresInvertColors = true
}
}
iOS Settings -> General -> Accessibility -> Accessibility Shortcut -> Check Smart Invert Colors
After that just triple click to activation.