@@ -102,7 +102,8 @@ public class NSCameraView: UIView, NextLevelVideoDelegate, NextLevelPhotoDelegat
102102 return ( self . nextLevel? . captureMode ?? NextLevelCaptureMode . photo) . rawValue
103103 }
104104 set {
105- self . nextLevel? . captureMode = NextLevelCaptureMode ( rawValue: newValue) !
105+ captureModeBeforePhoto = NextLevelCaptureMode ( rawValue: newValue) !
106+ self . nextLevel? . captureMode = captureModeBeforePhoto
106107 }
107108 }
108109
@@ -185,15 +186,15 @@ public class NSCameraView: UIView, NextLevelVideoDelegate, NextLevelPhotoDelegat
185186 }
186187 public func capturePhoto( ) {
187188 if let nextLevel = self . nextLevel , self . canCapturePhoto {
188- if ( nextLevel. captureMode == NextLevelCaptureMode . photo) {
189+ // if ( nextLevel.captureMode == NextLevelCaptureMode.photo) {
189190 nextLevel. capturePhoto ( )
190- } else {
191- captureModeBeforePhoto = nextLevel. captureMode
192- captureModeCompletionHandler = {
193- nextLevel. capturePhoto ( )
194- }
195- nextLevel. captureMode = NextLevelCaptureMode . photo
196- }
191+ // } else {
192+ // captureModeBeforePhoto = nextLevel.captureMode
193+ // captureModeCompletionHandler = {
194+ // nextLevel.capturePhoto()
195+ // }
196+ // nextLevel.captureMode = NextLevelCaptureMode.photo
197+ // }
197198 }
198199 }
199200 public func capturePhotoFromVideo( ) {
@@ -257,11 +258,7 @@ public class NSCameraView: UIView, NextLevelVideoDelegate, NextLevelPhotoDelegat
257258 }
258259
259260 public func nextLevelCaptureModeDidChange( _ nextLevel: NextLevel ) {
260- if ( self . captureModeCompletionHandler != nil ) {
261- DispatchQueue . main. asyncAfter ( deadline: . now( ) + . milliseconds( 100 ) , execute: {
262- self . captureModeCompletionHandler ? ( )
263- } )
264- }
261+ self . captureModeCompletionHandler ? ( )
265262 }
266263
267264 // MARK: NextLevelPhotoDelegate
0 commit comments