AccessibilityUIExamples/Switches/ThreePositionSwitchViewController.swift
/* |
See LICENSE folder for this sample’s licensing information. |
Abstract: |
View controller demonstrating an accessible, custom three-position switch. |
*/ |
import Cocoa |
class ThreePositionSwitchViewController: NSViewController { |
@IBOutlet var currentValueLabel: NSTextField! |
@IBOutlet var threePositionSwitch: ThreePositionSwitchView! |
// MARK: - Actions |
@IBAction func changeSwitchValue(_ sender: Any) { |
if let senderSwitch = sender as? ThreePositionSwitchView, |
let description = senderSwitch.accessibilityValue() as? String { |
currentValueLabel.stringValue = description.uppercased() |
} |
} |
} |
Copyright © 2017 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2017-09-12