2

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 ?

Justin
  • 20,509
  • 6
  • 47
  • 58
Sneha
  • 1,444
  • 15
  • 24
  • Please, mark an answer as accepted to let people know that your problem has a solution... iOS 7 is far away now and Justin's answer should do the job. Terima kasih banyak. ;o) – XLE_22 Sep 06 '19 at 09:29

3 Answers3

1

Yes, UIAccessibilityIsSwitchControlRunning() has been available since iOS 8. This API did not exist when your question was first posted.

Justin
  • 20,509
  • 6
  • 47
  • 58
0

As of iOS 8, you can use UIAccessibilityIsSwitchControlRunning()

djibouti33
  • 12,102
  • 9
  • 83
  • 116
0

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.

XLE_22
  • 5,124
  • 3
  • 21
  • 72