SwiftSpeech icon indicating copy to clipboard operation
SwiftSpeech copied to clipboard

IOS 18 breaks functionality

Open nigelfang opened this issue 1 year ago • 1 comments

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.

nigelfang avatar Dec 09 '24 20:12 nigelfang

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 }

nigelfang avatar Dec 21 '24 01:12 nigelfang