Skip to content

ostatnicky/SmartInvert-In-iOS11

Repository files navigation

Smart Invert In iOS11

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.

Code Example

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
    }
}

Accessibility Shortcut for Smart Invert

iOS Settings -> General -> Accessibility -> Accessibility Shortcut -> Check Smart Invert Colors

After that just triple click to activation.

About

Smart Invert iOS 11 feature example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages