SwiftSpeech
SwiftSpeech copied to clipboard
IOS 18 breaks functionality
When using RecordOnHold modifier for a SwiftSpeech button, executable console notes error: Thread 1: Fatal error: recordingSession is nil in endRecording(). Looking into it, seems like the problem is that longPress is not able to call self.startRecording and when user releases finger on the button it tries to end a recording that never started.
to anyone having this issue: it seems like replacing onChanged with onEnded and reducing the minimum duration in ViewModifiers.swift fixes the issue let longPress = LongPressGesture(minimumDuration: 0) .onEnded { _ in withAnimation(self.animation, self.startRecording) self.viewComponentState = .recording }