Reputation: 1444
I am working with a application which has a blue tooth Switch attached to it. With the new iOS 7 Switch Control API I need to check if the iOS 7 Switch Control API is On or not. Is there any API provided to check if the Switch Control is on in the setting ?
Upvotes: 2
Views: 300
Reputation: 5671
In Swift 5.0, besides the UIAccessibility.isSwitchControlRunning
state provided by Justin's answer, you can listen to the UIAccessibility.switchControlStatusDidChangeNotification event to be aware of the switch control status modification.
Upvotes: 0
Reputation: 20609
Yes, UIAccessibilityIsSwitchControlRunning()
has been available since iOS 8. This API did not exist when your question was first posted.
Upvotes: 1
Reputation: 12132
As of iOS 8, you can use UIAccessibilityIsSwitchControlRunning()
Upvotes: 0