Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS 18 breaks functionality #17

Open
nigelfang opened this issue Dec 9, 2024 · 1 comment
Open

IOS 18 breaks functionality #17

nigelfang opened this issue Dec 9, 2024 · 1 comment

Comments

@nigelfang
Copy link

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
Copy link
Author

nigelfang commented Dec 21, 2024

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant