Awalz / SwiftyCam

A Snapchat Inspired iOS Camera Framework written in Swift
BSD 2-Clause "Simplified" License
2.08k stars 326 forks source link

didFinishRecordingVideo not getting called bug #192

Closed dadalar closed 5 years ago

dadalar commented 5 years ago

Fix a bug where didFinishRecordingVideo delegate method wasn't being called if stopVideoRecording gets called before the actual recording starts.

You can reproduce this issue by just stopping video recording as soon as it starts. Since the actual recording starts asynchronously, self.movieFileOutput?.isRecording doesn't get set to true yet and stopVideoRecording function doesn't do it's job. By making this change we try to stop even if the recording isn't started and it prints an error (which is something we want) but the delegate method gets called.

jonandersen commented 5 years ago

Great thanks for your changes!