From 5f5d443377ab2a00bf945c1d4ba8554515829e6d Mon Sep 17 00:00:00 2001 From: Snesnopic Date: Thu, 16 May 2024 17:15:09 +0200 Subject: [PATCH] iOS 16 now supported --- Morser.xcodeproj/project.pbxproj | 4 ++-- Morser/Model/SpeechRecognizer.swift | 24 ++++++++++++------------ Morser/Views/SettingsView.swift | 5 +++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Morser.xcodeproj/project.pbxproj b/Morser.xcodeproj/project.pbxproj index 604dac2..04afadf 100644 --- a/Morser.xcodeproj/project.pbxproj +++ b/Morser.xcodeproj/project.pbxproj @@ -383,7 +383,7 @@ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MARKETING_VERSION = 1.2; @@ -428,7 +428,7 @@ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MARKETING_VERSION = 1.2; diff --git a/Morser/Model/SpeechRecognizer.swift b/Morser/Model/SpeechRecognizer.swift index c309244..3793bcc 100644 --- a/Morser/Model/SpeechRecognizer.swift +++ b/Morser/Model/SpeechRecognizer.swift @@ -51,9 +51,9 @@ actor SpeechRecognizer: ObservableObject { guard await SFSpeechRecognizer.hasAuthorizationToRecognize() else { throw RecognizerError.notAuthorizedToRecognize } - guard await AVAudioSession.sharedInstance().hasPermissionToRecord() else { - throw RecognizerError.notPermittedToRecord - } +// guard await AVAudioSession.sharedInstance().hasPermissionToRecord() else { +// throw RecognizerError.notPermittedToRecord +// } } catch { transcribe(error) } @@ -180,12 +180,12 @@ extension SFSpeechRecognizer { } } -extension AVAudioSession { - func hasPermissionToRecord() async -> Bool { - await withCheckedContinuation { continuation in - AVAudioApplication.requestRecordPermission { authorized in - continuation.resume(returning: authorized) - } - } - } -} +//extension AVAudioSession { +// func hasPermissionToRecord() async -> Bool { +// await withCheckedContinuation { continuation in +// AVAudioApplication.requestRecordPermission { authorized in +// continuation.resume(returning: authorized) +// } +// } +// } +//} diff --git a/Morser/Views/SettingsView.swift b/Morser/Views/SettingsView.swift index 69e05ea..614e741 100644 --- a/Morser/Views/SettingsView.swift +++ b/Morser/Views/SettingsView.swift @@ -47,9 +47,10 @@ struct SettingsView: View { Slider(value: $sliderPreference, in: (1.0)...(5.0)) { Text("Haptics Speed (\(sliderPreference))") } - .onChange(of: sliderPreference) { oldValue, newValue in + .onChange(of: sliderPreference, perform: { value in VibrationEngine.shared.updateTimings() - } + }) + } header: { Text("Timings") }