diff --git a/PhotoBrowser/ZLCustomCamera.m b/PhotoBrowser/ZLCustomCamera.m index 11aeb83f..0b3488c5 100644 --- a/PhotoBrowser/ZLCustomCamera.m +++ b/PhotoBrowser/ZLCustomCamera.m @@ -35,10 +35,6 @@ - (void)onFinishRecord; 重新拍照或录制 */ - (void)onRetake; -/** - 调整焦距 - */ -- (void)onAdjustFocus:(CGFloat)zoomFactor; /** 点击确定 */ @@ -50,10 +46,8 @@ - (void)onDismiss; @interface CameraToolView : UIView { - //避免动画及长按收拾触发两次 + //避免动画及长按手势触发两次 BOOL _stopRecord; - //是否触发了长按手势的录制,如果触发,则pan手势有效 - BOOL _hadTriggerRecord; BOOL _layoutOK; } @@ -104,6 +98,7 @@ - (void)layoutSubviews { [super layoutSubviews]; if (_layoutOK) return; + _layoutOK = YES; CGFloat height = GetViewHeight(self); self.bottomView.frame = CGRectMake(0, 0, height*kBottomViewScale, height*kBottomViewScale); @@ -131,10 +126,6 @@ - (void)setAllowRecordVideo:(BOOL)allowRecordVideo longG.minimumPressDuration = .3; longG.delegate = self; [self.bottomView addGestureRecognizer:longG]; - - UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)]; - pan.delegate = self; - [self.bottomView addGestureRecognizer:pan]; } } @@ -194,7 +185,6 @@ - (void)longPressAction:(UILongPressGestureRecognizer *)longG { //此处不启动动画,由vc界面开始录制之后启动 _stopRecord = NO; - _hadTriggerRecord = YES; if (self.delegate && [self.delegate respondsToSelector:@selector(onStartRecord)]) { [self.delegate performSelector:@selector(onStartRecord)]; } @@ -203,8 +193,6 @@ - (void)longPressAction:(UILongPressGestureRecognizer *)longG case UIGestureRecognizerStateCancelled: case UIGestureRecognizerStateEnded: { - _hadTriggerRecord = NO; - if (_stopRecord) return; _stopRecord = YES; [self stopAnimate]; @@ -219,26 +207,9 @@ - (void)longPressAction:(UILongPressGestureRecognizer *)longG } } -- (void)panAction:(UIPanGestureRecognizer *)pan -{ - if (!_hadTriggerRecord) return; - - CGRect caremaViewRect = [self convertRect:self.bottomView.frame toView:self.superview]; - CGPoint lp = [pan locationInView:self]; - CGPoint point = [self convertPoint:lp toView:self.superview]; - - CGFloat zoomFactor = (CGRectGetMidY(caremaViewRect)-point.y)/CGRectGetMidY(caremaViewRect) * 10; - - if (self.delegate && [self.delegate respondsToSelector:@selector(onAdjustFocus:)]) { - [self.delegate performSelector:@selector(onAdjustFocus:) withObject:@(MIN(MAX(zoomFactor, 1), 10))]; - } -} - - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(nonnull UIGestureRecognizer *)otherGestureRecognizer { - if (([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) - || - ([otherGestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]] && [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]])) { + if (([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]])) { return YES; } return NO; @@ -358,8 +329,6 @@ @interface ZLCustomCamera () #import "ZLDefine.h" diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index a006a921..06ae2cee 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -108,12 +108,12 @@ 7877CB716903B2DCD930BB7BB783DA45 /* UIImageView+HighlightedWebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+HighlightedWebCache.h"; path = "SDWebImage/UIImageView+HighlightedWebCache.h"; sourceTree = ""; }; 7B368094668A968BBF1F14F7A7B43D2B /* SDWebImageGIFCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageGIFCoder.h; path = SDWebImage/SDWebImageGIFCoder.h; sourceTree = ""; }; 870E04ADBBF0A03AEAE84E2437F3E466 /* SDWebImageDownloader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloader.h; path = SDWebImage/SDWebImageDownloader.h; sourceTree = ""; }; - 8A68DCAD40F8C2B093766CDDA5AD5A06 /* libSDWebImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libSDWebImage.a; path = libSDWebImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 8A68DCAD40F8C2B093766CDDA5AD5A06 /* libSDWebImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDWebImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; 8B07AD85B258CDEF5722C9E6D7B4AAAC /* UIView+WebCacheOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCacheOperation.h"; path = "SDWebImage/UIView+WebCacheOperation.h"; sourceTree = ""; }; 8EEDE37B578818F94087CC5EA8039933 /* SDWebImageCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCoder.m; path = SDWebImage/SDWebImageCoder.m; sourceTree = ""; }; 8FD2D0BF28C443CB776E7DD0503F793A /* UIView+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+WebCache.m"; path = "SDWebImage/UIView+WebCache.m"; sourceTree = ""; }; 92A8DA25F95CDD5435A84C862BAD9F0E /* SDWebImageFrame.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageFrame.h; path = SDWebImage/SDWebImageFrame.h; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 995CCED8B979428D90DD03B5317D0009 /* SDWebImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SDWebImage-prefix.pch"; sourceTree = ""; }; 9B215C24FB625EF6231BC31D95A1FB8C /* SDImageCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCache.m; path = SDWebImage/SDImageCache.m; sourceTree = ""; }; 9C5C182BBE8331E0FA7575D49645E079 /* SDWebImageManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageManager.m; path = SDWebImage/SDWebImageManager.m; sourceTree = ""; }; @@ -127,7 +127,7 @@ C760595D53272E5FCEA7D46CB3969FD2 /* UIImage+MultiFormat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+MultiFormat.m"; path = "SDWebImage/UIImage+MultiFormat.m"; sourceTree = ""; }; C97E0C0525EBFF3953D461E49F22B8ED /* SDImageCacheConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageCacheConfig.h; path = SDWebImage/SDImageCacheConfig.h; sourceTree = ""; }; D32AB757802F05A91CDC12982040B4BA /* SDWebImageImageIOCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageImageIOCoder.h; path = SDWebImage/SDWebImageImageIOCoder.h; sourceTree = ""; }; - E089285270D97F5409D224FC30446A16 /* libPods-ZLPhotoBrowser.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-ZLPhotoBrowser.a"; path = "libPods-ZLPhotoBrowser.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + E089285270D97F5409D224FC30446A16 /* libPods-ZLPhotoBrowser.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ZLPhotoBrowser.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E47A8A0C253685E8A29AA825EC36A2FA /* Pods-ZLPhotoBrowser-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ZLPhotoBrowser-acknowledgements.markdown"; sourceTree = ""; }; EAA49F5EB99E7F68C323572ACF7C785C /* Pods-ZLPhotoBrowser.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ZLPhotoBrowser.debug.xcconfig"; sourceTree = ""; }; F053297E806128C4F7FB34A00DEA0838 /* UIView+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCache.h"; path = "SDWebImage/UIView+WebCache.h"; sourceTree = ""; }; @@ -163,7 +163,6 @@ D2999FFEBC5E3ACE1A802164BDEDFC21 /* Core */, 9EB7D73A7668D27CEB5859D55BC1C469 /* Support Files */, ); - name = SDWebImage; path = SDWebImage; sourceTree = ""; }; @@ -378,7 +377,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0910; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; @@ -460,7 +459,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -468,15 +469,21 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_DEBUG=1", @@ -509,7 +516,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -517,14 +526,20 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_RELEASE=1", "$(inherited)", @@ -554,7 +569,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; @@ -601,7 +616,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; diff --git a/README.md b/README.md index 38cd36c5..cbdb9343 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ actionSheet.sender = self; ![image](https://github.com/longitachi/ZLPhotoBrowser/blob/master/效果图/edit.gif) - 自定义相机效果图及介绍 + ![image](https://github.com/longitachi/ZLPhotoBrowser/blob/master/效果图/customCamera.gif) ![image](https://github.com/longitachi/ZLPhotoBrowser/blob/master/效果图/introduce.png) diff --git a/ZLPhotoBrowser.podspec b/ZLPhotoBrowser.podspec index bf9f376c..81d425c4 100644 --- a/ZLPhotoBrowser.podspec +++ b/ZLPhotoBrowser.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ZLPhotoBrowser' - s.version = '2.5.1' + s.version = '2.5.1.1' s.summary = 'A simple way to multiselect photos from ablum, force touch to preview photo, support portrait and landscape, edit photo, multiple languages(Chinese,English,Japanese)' s.homepage = 'https://github.com/longitachi/ZLPhotoBrowser' s.license = 'MIT' diff --git a/ZLPhotoBrowser.xcodeproj/project.pbxproj b/ZLPhotoBrowser.xcodeproj/project.pbxproj index 3e935ae8..e2f12247 100644 --- a/ZLPhotoBrowser.xcodeproj/project.pbxproj +++ b/ZLPhotoBrowser.xcodeproj/project.pbxproj @@ -284,6 +284,11 @@ FD07871C1C0D45A200D17B97 = { CreatedOnToolsVersion = 7.1; DevelopmentTeam = 47UY3G7UH6; + SystemCapabilities = { + com.apple.BackgroundModes = { + enabled = 0; + }; + }; }; }; }; diff --git a/ZLPhotoBrowser.xcodeproj/xcuserdata/long.xcuserdatad/xcschemes/ZLPhotoBrowser.xcscheme b/ZLPhotoBrowser.xcodeproj/xcuserdata/long.xcuserdatad/xcschemes/ZLPhotoBrowser.xcscheme index 9e09c90d..01f57650 100644 --- a/ZLPhotoBrowser.xcodeproj/xcuserdata/long.xcuserdatad/xcschemes/ZLPhotoBrowser.xcscheme +++ b/ZLPhotoBrowser.xcodeproj/xcuserdata/long.xcuserdatad/xcschemes/ZLPhotoBrowser.xcscheme @@ -1,6 +1,6 @@ en CFBundleDisplayName ZLPhotoBrowser - NSMicrophoneUsageDescription - 是否允许访问你的麦克风? CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -35,6 +33,8 @@ NSCameraUsageDescription 是否允许访问你的相机? + NSMicrophoneUsageDescription + 是否允许访问你的麦克风? NSPhotoLibraryUsageDescription 是否允许访问你的相册? UILaunchStoryboardName diff --git a/ZLPhotoBrowser/ViewController.m b/ZLPhotoBrowser/ViewController.m index 9446b9c2..b265714c 100644 --- a/ZLPhotoBrowser/ViewController.m +++ b/ZLPhotoBrowser/ViewController.m @@ -91,7 +91,7 @@ - (ZLPhotoActionSheet *)getPas { ZLPhotoActionSheet *actionSheet = [[ZLPhotoActionSheet alloc] init]; -#pragma optional +#pragma mark - optional //以下参数为自定义参数,均可不设置,有默认值 actionSheet.sortAscending = self.sortSegment.selectedSegmentIndex==0; actionSheet.allowSelectImage = self.selImageSwitch.isOn; @@ -129,7 +129,9 @@ - (ZLPhotoActionSheet *)getPas //允许框架解析图片 actionSheet.shouldAnialysisAsset = self.allowAnialysisAssetSwitch.isOn; actionSheet.languageType = self.languageSegment.selectedSegmentIndex; -#pragma required +// actionSheet.useSystemCamera = YES; +// actionSheet.sessionPreset = ZLCaptureSessionPreset1920x1080; +#pragma mark - required //如果调用的方法没有传sender,则该属性必须提前赋值 actionSheet.sender = self;