OperationNodeSingle.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // OperationNodeSingle.m
  3. // sampleSDK
  4. //
  5. // Created by 王昭威 on 2023/1/17.
  6. //
  7. #import "PCSBaseViewController.h"
  8. #import "OperationNodeSingle.h"
  9. #import "LenzSDKConstant.h"
  10. #import "LenzHeader.h"
  11. @implementation OperationNodeSingle
  12. - (instancetype)initWithController:(PCSBaseViewController *)controller{
  13. self = [super init];
  14. if(self){
  15. _controller = controller;
  16. }
  17. return self;
  18. }
  19. - (SDKCaptureModeIndex)modeIndex{
  20. return SDK_CAPTURE_MODE_SINGLE;
  21. }
  22. - (NSString *)modeItemString{
  23. return @"单拍";
  24. }
  25. - (NSString *)modeTitleString{
  26. return LOCALIZATION_STRING_KEY_MODE_TITLE_SINGLE;
  27. }
  28. - (void)save {
  29. // UIImageWriteToSavedPhotosAlbum(self.controller.capturedImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
  30. if ([self.controller respondsToSelector:@selector(savePhotoButtonTouchUpInside:)]) {
  31. [self.controller savePhotoButtonTouchUpInside:[NSObject new]];
  32. }
  33. }
  34. - (void)clear {
  35. [self.controller clearSingleData];
  36. }
  37. - (void)takePhotoButtonTouched{
  38. [self.controller takeStillPhoto];
  39. }
  40. - (void)triggered {
  41. // NSLog(@"12321");
  42. }
  43. - (void)discardPhotoResultButtonTouchUpInside{
  44. [self.controller startCaptureSession];
  45. [self.controller showPreviewView:YES];
  46. }
  47. - (void)updateUI{
  48. // self.controller.backButton.hidden = NO;
  49. // self.controller.savePhotoButton.hidden = YES;
  50. // self.controller.discardPhotoButton.hidden = YES;
  51. // self.controller.albumButton.hidden = YES;
  52. }
  53. - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
  54. if(error != nil){
  55. return;
  56. }
  57. [self.controller dismissViewControllerAnimated:YES completion:^{}];
  58. }
  59. - (void)willQuitOnCompletion: (WillQuitCompletionBlockType)block{
  60. block();
  61. }
  62. @end