diff options
author | NicoleYarroch <nicole@livio.io> | 2020-09-01 11:52:46 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2020-09-01 11:52:46 -0400 |
commit | 4065362b2e4b1c61feab2230153092426fdc012e (patch) | |
tree | ae08a09f6819a04ead26aa28a0f6f454aadd9b3a /Example Apps | |
parent | 049ffa2fe864a210d648371ed888e1803540674c (diff) | |
download | sdl_ios-4065362b2e4b1c61feab2230153092426fdc012e.tar.gz |
Removed available checkes from Swift Ex. App
Signed-off-by: NicoleYarroch <nicole@livio.io>
Diffstat (limited to 'Example Apps')
-rw-r--r-- | Example Apps/Example Swift/AudioManager.swift | 4 | ||||
-rw-r--r-- | Example Apps/Example Swift/MenuManager.swift | 12 |
2 files changed, 3 insertions, 13 deletions
diff --git a/Example Apps/Example Swift/AudioManager.swift b/Example Apps/Example Swift/AudioManager.swift index cfbc4538f..8300bcb18 100644 --- a/Example Apps/Example Swift/AudioManager.swift +++ b/Example Apps/Example Swift/AudioManager.swift @@ -19,7 +19,6 @@ fileprivate enum SpeechRecognitionAuthState { case authorized, notAuthorized, badRegion } -@available(iOS 10.0, *) class AudioManager: NSObject { fileprivate let sdlManager: SDLManager fileprivate var audioData: Data? @@ -88,7 +87,6 @@ class AudioManager: NSObject { // MARK: - Audio Pass Thru Notifications -@available(iOS 10.0, *) private extension AudioManager { /// SDL streams the audio data as it is collected. var audioDataReceivedHandler: SDLAudioPassThruHandler? { @@ -144,7 +142,6 @@ private extension AudioManager { // MARK: - Speech Recognition -@available(iOS 10.0, *) private extension AudioManager { /// Configures speech recognition func startSpeechRecognitionTask() { @@ -186,7 +183,6 @@ private extension AudioManager { // MARK: - Speech Recognition Authorization -@available(iOS 10.0, *) extension AudioManager: SFSpeechRecognizerDelegate { func speechRecognizer(_ speechRecognizer: SFSpeechRecognizer, availabilityDidChange available: Bool) { speechRecognitionAuthState = AudioManager.checkAuthorization(speechRecognizer: speechRecognizer) diff --git a/Example Apps/Example Swift/MenuManager.swift b/Example Apps/Example Swift/MenuManager.swift index 3981bc7fa..1b0830f48 100644 --- a/Example Apps/Example Swift/MenuManager.swift +++ b/Example Apps/Example Swift/MenuManager.swift @@ -90,15 +90,9 @@ private extension MenuManager { /// - Parameter manager: The SDL Manager /// - Returns: A SDLMenuCell object class func menuCellRecordInCarMicrophoneAudio(with manager: SDLManager) -> SDLMenuCell { - if #available(iOS 10.0, *) { - let audioManager = AudioManager(sdlManager: manager) - return SDLMenuCell(title: ACRecordInCarMicrophoneAudioMenuName, icon: SDLArtwork(image: UIImage(named: MicrophoneBWIconImageName)!.withRenderingMode(.alwaysTemplate), persistent: true, as: .PNG), voiceCommands: [ACRecordInCarMicrophoneAudioMenuName], handler: { _ in - audioManager.startRecording() - }) - } - - return SDLMenuCell(title: ACRecordInCarMicrophoneAudioMenuName, icon: SDLArtwork(image: UIImage(named: SpeakBWIconImageName)!.withRenderingMode(.alwaysTemplate), persistent: true, as: .PNG), voiceCommands: [ACRecordInCarMicrophoneAudioMenuName], handler: { _ in - AlertManager.sendAlert(textField1: "Speech recognition feature only available on iOS 10+", sdlManager: manager) + let audioManager = AudioManager(sdlManager: manager) + return SDLMenuCell(title: ACRecordInCarMicrophoneAudioMenuName, icon: SDLArtwork(image: UIImage(named: MicrophoneBWIconImageName)!.withRenderingMode(.alwaysTemplate), persistent: true, as: .PNG), voiceCommands: [ACRecordInCarMicrophoneAudioMenuName], handler: { _ in + audioManager.startRecording() }) } |