Skip to content

Commit

Permalink
iOS 16 now supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Snesnopic committed May 16, 2024
1 parent 7d9c129 commit 5f5d443
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Morser.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
24 changes: 12 additions & 12 deletions Morser/Model/SpeechRecognizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
// }
// }
// }
//}
5 changes: 3 additions & 2 deletions Morser/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 5f5d443

Please sign in to comment.