Created
September 17, 2024 15:15
-
-
Save mterekhov/54f9afe3ed02472a0285be900308623c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var headphonesAreActive = false | |
loop: for currentOutput in audioSession.currentRoute.outputs { | |
switch currentOutput.portType { | |
case .headphones, .bluetoothA2DP, .bluetoothHFP: | |
headphonesAreActive = true | |
hasHeadphones = true | |
hasBluetoothHeadphones = [.bluetoothA2DP, .bluetoothHFP].contains(currentOutput.portType) | |
activeOutput = .headphones | |
break loop | |
default: | |
break | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
вот туточки break loop