├── .gitignore
├── ImagePickerSheet.xcworkspace
└── contents.xcworkspacedata
├── ImagePickerSheet
├── ImagePickerSheet.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
└── ImagePickerSheet
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Base.lproj
│ ├── LaunchScreen.xib
│ └── Main.storyboard
│ ├── ImagePickerSheetViewController
│ ├── DefineHeader.h
│ ├── ImageCollectionViewCell.h
│ ├── ImageCollectionViewCell.m
│ ├── ImagePickerCollectionView.h
│ ├── ImagePickerCollectionView.m
│ ├── ImagePickerSheetViewController.h
│ ├── ImagePickerSheetViewController.m
│ ├── ImagePreviewFlowLayout.h
│ ├── ImagePreviewFlowLayout.m
│ ├── ImageTableViewCell.h
│ ├── ImageTableViewCell.m
│ ├── PreviewSupplementaryView.h
│ ├── PreviewSupplementaryView.m
│ └── SupplementaryView.bundle
│ │ ├── PreviewSupplementaryView-Checkmark-Selected.png
│ │ ├── PreviewSupplementaryView-Checkmark-Selected@2x.png
│ │ ├── PreviewSupplementaryView-Checkmark-Selected@3x.png
│ │ ├── PreviewSupplementaryView-Checkmark.png
│ │ ├── PreviewSupplementaryView-Checkmark@2x.png
│ │ └── PreviewSupplementaryView-Checkmark@3x.png
│ ├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Info.plist
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── ImagePickerSheetViewController.podspec
├── LICENSE
├── Podfile
├── Podfile.lock
├── Pods
├── LFAssetExportSession
│ ├── LFAssetExportSession
│ │ └── LFAssetExportSession
│ │ │ └── class
│ │ │ ├── LFAssetExportSession.h
│ │ │ └── LFAssetExportSession.m
│ ├── LICENSE
│ └── README.md
├── LFImagePickerController
│ ├── LFImagePickerController
│ │ └── LFImagePickerController
│ │ │ ├── class
│ │ │ ├── LFImagePickerController.bundle
│ │ │ │ ├── LFImagePickerController.strings
│ │ │ │ ├── MMVideoPreviewPlay@2x.png
│ │ │ │ ├── MMVideoPreviewPlayHL@2x.png
│ │ │ │ ├── ablum_sel@2x.png
│ │ │ │ ├── album_list_img_default@2x.png
│ │ │ │ ├── contacts_add_myablum@2x.png
│ │ │ │ ├── fileicon_gif_wall@2x.png
│ │ │ │ ├── fileicon_hor_wall@2x.png
│ │ │ │ ├── fileicon_live_wall@2x.png
│ │ │ │ ├── fileicon_piiic_wall@2x.png
│ │ │ │ ├── fileicon_video_wall@2x.png
│ │ │ │ ├── navigationbar_back_arrow@2x.png
│ │ │ │ ├── photo_album_def@2x.png
│ │ │ │ ├── photo_album_sel@2x.png
│ │ │ │ ├── photo_original_def@2x.png
│ │ │ │ ├── photo_original_sel@2x.png
│ │ │ │ ├── takePicture@2x.png
│ │ │ │ ├── titleView_arrow@2x.png
│ │ │ │ ├── video_pause@2x.png
│ │ │ │ └── video_play@2x.png
│ │ │ ├── LFImagePickerController.h
│ │ │ ├── LFImagePickerController.m
│ │ │ ├── LFLayoutPickerController.h
│ │ │ ├── LFLayoutPickerController.m
│ │ │ ├── cell
│ │ │ │ ├── LFAlbumCell.h
│ │ │ │ ├── LFAlbumCell.m
│ │ │ │ ├── LFAssetCell.h
│ │ │ │ ├── LFAssetCell.m
│ │ │ │ ├── LFPhotoPreviewCell.h
│ │ │ │ ├── LFPhotoPreviewCell.m
│ │ │ │ ├── LFPhotoPreviewCell_property.h
│ │ │ │ ├── LFPhotoPreviewGifCell.h
│ │ │ │ ├── LFPhotoPreviewGifCell.m
│ │ │ │ ├── LFPhotoPreviewLivePhotoCell.h
│ │ │ │ ├── LFPhotoPreviewLivePhotoCell.m
│ │ │ │ ├── LFPhotoPreviewVideoCell.h
│ │ │ │ └── LFPhotoPreviewVideoCell.m
│ │ │ ├── controller
│ │ │ │ ├── LFBaseViewController.h
│ │ │ │ ├── LFBaseViewController.m
│ │ │ │ ├── LFPhotoPickerController+preview.h
│ │ │ │ ├── LFPhotoPickerController.h
│ │ │ │ ├── LFPhotoPickerController.m
│ │ │ │ ├── LFPhotoPreviewController.h
│ │ │ │ └── LFPhotoPreviewController.m
│ │ │ ├── define
│ │ │ │ ├── LFImagePickerController+property.h
│ │ │ │ ├── LFImagePickerHeader.h
│ │ │ │ ├── LFImagePickerHeader.m
│ │ │ │ ├── LFImagePickerPublicHeader.h
│ │ │ │ └── LFResultObject_property.h
│ │ │ ├── manager
│ │ │ │ ├── LFAssetManager+Authorization.h
│ │ │ │ ├── LFAssetManager+Authorization.m
│ │ │ │ ├── LFAssetManager+CreateMedia.h
│ │ │ │ ├── LFAssetManager+CreateMedia.m
│ │ │ │ ├── LFAssetManager+SaveAlbum.h
│ │ │ │ ├── LFAssetManager+SaveAlbum.m
│ │ │ │ ├── LFAssetManager+Simple.h
│ │ │ │ ├── LFAssetManager+Simple.m
│ │ │ │ ├── LFAssetManager.h
│ │ │ │ ├── LFAssetManager.m
│ │ │ │ ├── LFPhotoEditManager.h
│ │ │ │ ├── LFPhotoEditManager.m
│ │ │ │ ├── LFVideoEditManager.h
│ │ │ │ └── LFVideoEditManager.m
│ │ │ ├── model
│ │ │ │ ├── LFAlbum+SmartAlbum.h
│ │ │ │ ├── LFAlbum+SmartAlbum.m
│ │ │ │ ├── LFAlbum.h
│ │ │ │ ├── LFAlbum.m
│ │ │ │ ├── LFAsset+property.h
│ │ │ │ ├── LFAsset.h
│ │ │ │ ├── LFAsset.m
│ │ │ │ ├── LFAssetImageProtocol.h
│ │ │ │ ├── LFAssetPhotoProtocol.h
│ │ │ │ ├── LFAssetVideoProtocol.h
│ │ │ │ └── result
│ │ │ │ │ ├── LFResultImage.h
│ │ │ │ │ ├── LFResultImage.m
│ │ │ │ │ ├── LFResultInfo.h
│ │ │ │ │ ├── LFResultInfo.m
│ │ │ │ │ ├── LFResultObject.h
│ │ │ │ │ ├── LFResultObject.m
│ │ │ │ │ ├── LFResultVideo.h
│ │ │ │ │ └── LFResultVideo.m
│ │ │ ├── utils
│ │ │ │ ├── CancelBlock
│ │ │ │ │ └── LFCancelBlock.h
│ │ │ │ ├── Category
│ │ │ │ │ ├── NSBundle+LFImagePicker.h
│ │ │ │ │ ├── NSBundle+LFImagePicker.m
│ │ │ │ │ ├── NSString+LFExtendedStringDrawing.h
│ │ │ │ │ ├── NSString+LFExtendedStringDrawing.m
│ │ │ │ │ ├── UIAlertView+LF_Block.h
│ │ │ │ │ ├── UIAlertView+LF_Block.m
│ │ │ │ │ ├── UIImage+LFCommon.h
│ │ │ │ │ ├── UIImage+LFCommon.m
│ │ │ │ │ ├── UIImage+LFDecoded.h
│ │ │ │ │ ├── UIImage+LFDecoded.m
│ │ │ │ │ ├── UIImage+LF_Format.h
│ │ │ │ │ ├── UIImage+LF_Format.m
│ │ │ │ │ ├── UIImage+LF_ImageCompress.h
│ │ │ │ │ ├── UIImage+LF_ImageCompress.m
│ │ │ │ │ ├── UIScrollView+LFDragAutoScroll.h
│ │ │ │ │ ├── UIScrollView+LFDragAutoScroll.m
│ │ │ │ │ ├── UIView+LFAnimate.h
│ │ │ │ │ └── UIView+LFAnimate.m
│ │ │ │ ├── FileUtils
│ │ │ │ │ ├── LF_FileUtility.h
│ │ │ │ │ └── LF_FileUtility.m
│ │ │ │ ├── GIFUtils
│ │ │ │ │ ├── LFGIFImageSerialization.h
│ │ │ │ │ └── LFGIFImageSerialization.m
│ │ │ │ └── VideoUtils
│ │ │ │ │ ├── LF_VideoUtils.h
│ │ │ │ │ └── LF_VideoUtils.m
│ │ │ └── view
│ │ │ │ ├── ablumTitleView
│ │ │ │ ├── LFAlbumTitleView.h
│ │ │ │ └── LFAlbumTitleView.m
│ │ │ │ └── previewBar
│ │ │ │ ├── LFPreviewBar.h
│ │ │ │ ├── LFPreviewBar.m
│ │ │ │ └── subView
│ │ │ │ ├── LFPreviewBarCell.h
│ │ │ │ └── LFPreviewBarCell.m
│ │ │ └── vendors
│ │ │ ├── LFGifPlayer
│ │ │ ├── LFGifPlayerManager.h
│ │ │ ├── LFGifPlayerManager.m
│ │ │ ├── LFWeakProxy.h
│ │ │ └── LFWeakProxy.m
│ │ │ └── LFToGIF
│ │ │ ├── LFToGIF.h
│ │ │ └── LFToGIF.m
│ ├── LICENSE
│ └── README.md
├── Manifest.lock
├── Pods.xcodeproj
│ └── project.pbxproj
└── Target Support Files
│ ├── LFAssetExportSession
│ ├── LFAssetExportSession-Info.plist
│ ├── LFAssetExportSession-dummy.m
│ ├── LFAssetExportSession-prefix.pch
│ ├── LFAssetExportSession-umbrella.h
│ ├── LFAssetExportSession.debug.xcconfig
│ ├── LFAssetExportSession.modulemap
│ └── LFAssetExportSession.release.xcconfig
│ ├── LFImagePickerController
│ ├── LFImagePickerController-Info.plist
│ ├── LFImagePickerController-dummy.m
│ ├── LFImagePickerController-prefix.pch
│ ├── LFImagePickerController-umbrella.h
│ ├── LFImagePickerController.debug.xcconfig
│ ├── LFImagePickerController.modulemap
│ ├── LFImagePickerController.release.xcconfig
│ └── LFImagePickerController.xcconfig
│ └── Pods-ImagePickerSheet
│ ├── Pods-ImagePickerSheet-Info.plist
│ ├── Pods-ImagePickerSheet-acknowledgements.markdown
│ ├── Pods-ImagePickerSheet-acknowledgements.plist
│ ├── Pods-ImagePickerSheet-dummy.m
│ ├── Pods-ImagePickerSheet-frameworks.sh
│ ├── Pods-ImagePickerSheet-resources.sh
│ ├── Pods-ImagePickerSheet-umbrella.h
│ ├── Pods-ImagePickerSheet.debug.xcconfig
│ ├── Pods-ImagePickerSheet.modulemap
│ └── Pods-ImagePickerSheet.release.xcconfig
├── README.md
└── screenshots
├── screenshot.gif
└── screenshot.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | #Pods/
27 |
--------------------------------------------------------------------------------
/ImagePickerSheet.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/7.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/7.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/DefineHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // DefineHeader.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/9.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #ifndef ImagePickerSheet_DefineHeader_h
10 | #define ImagePickerSheet_DefineHeader_h
11 |
12 | #define NLSystemVersionGreaterOrEqualThan(version) ([[[UIDevice currentDevice] systemVersion] floatValue] >= version)
13 | #define IOS7_OR_LATER NLSystemVersionGreaterOrEqualThan(7.0)
14 | #define IOS8_OR_LATER NLSystemVersionGreaterOrEqualThan(8.0)
15 | #define IOS9_OR_LATER NLSystemVersionGreaterOrEqualThan(9.0)
16 |
17 | /** ImagePickerSheetViewController */
18 |
19 | /** 屏幕大小 */
20 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width
21 | #define ScreenHeight [UIScreen mainScreen].bounds.size.height
22 | /** 选择器高度 */
23 | #define tableViewPreviewRowHeight (ceilf((ScreenHeight > ScreenWidth ? ScreenHeight*0.2 : ScreenHeight*0.3)))
24 | #define tableViewEnlargedPreviewRowHeight (ceilf((ScreenHeight > ScreenWidth ? ScreenHeight*0.3 : ScreenHeight*0.4)))
25 | #define tableViewCellHeight 50.0
26 | /** 选择器放大扩展高度 */
27 | #define imagePickerExpandHeight ScreenHeight*0.1
28 | /** 打勾图标间距 */
29 | #define kCollectionViewCheckmarkInset 3.5
30 |
31 | /** 图片的最小宽度 */
32 | #define kImageMinMargin 80.f
33 |
34 | /** ImagePickerView */
35 | #define UIColorFromRGB(rgbValue) [UIColor \
36 | colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
37 | green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
38 | blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
39 |
40 | #define kPhotoBtnTitle @"相册"
41 | #define kCameraBtnTitle @"拍照"
42 | #define kCancelBtnTitle @"取消"
43 |
44 | /** ImageCollectionViewFlowLayout */
45 | /** 显示图片间距 */
46 | #define collectionViewInset 5.0
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImageCollectionViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCollectionViewCell.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/8.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ImageCollectionViewCell : UICollectionViewCell
12 |
13 | /** 重用标识 */
14 | + (NSString *)identifier;
15 |
16 | @property (nonatomic, strong) UIImageView *imageView;
17 | @end
18 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImageCollectionViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCollectionViewCell.m
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/8.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import "ImageCollectionViewCell.h"
10 |
11 | @interface ImageCollectionViewCell ()
12 |
13 | @end
14 |
15 | @implementation ImageCollectionViewCell
16 |
17 | + (NSString *)identifier
18 | {
19 | return NSStringFromClass([self class]);
20 | }
21 |
22 | - (instancetype)initWithFrame:(CGRect)frame
23 | {
24 | self = [super initWithFrame:frame];
25 | if (self) {
26 | [self initialize];
27 | }
28 | return self;
29 | }
30 |
31 | - (id)initWithCoder:(NSCoder *)aDecoder
32 | {
33 | self = [super initWithCoder:aDecoder];
34 | if (self) {
35 | [self initialize];
36 | }
37 | return self;
38 | }
39 |
40 | - (void)initialize
41 | {
42 | [self.contentView addSubview:self.imageView];
43 | }
44 |
45 | - (UIImageView *)imageView
46 | {
47 | if (_imageView == nil) {
48 | _imageView = [[UIImageView alloc] init];
49 | _imageView.contentMode = UIViewContentModeScaleAspectFill;
50 | _imageView.clipsToBounds = YES;
51 | }
52 | return _imageView;
53 | }
54 |
55 | - (void)prepareForReuse
56 | {
57 | [super prepareForReuse];
58 | // self.imageView = nil;
59 | }
60 |
61 | - (void)layoutSubviews
62 | {
63 | [super layoutSubviews];
64 | self.imageView.frame = self.bounds;
65 | }
66 |
67 | @end
68 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImagePickerCollectionView.h:
--------------------------------------------------------------------------------
1 | //
2 | // ImagePickerCollectionView.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/10.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 | @class ImagePreviewFlowLayout;
11 |
12 | @interface ImagePickerCollectionView : UICollectionView
13 |
14 | @property (nonatomic, strong) ImagePreviewFlowLayout *imagePreviewLayout;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImagePickerCollectionView.m:
--------------------------------------------------------------------------------
1 | //
2 | // ImagePickerCollectionView.m
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/10.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import "ImagePickerCollectionView.h"
10 | #import "ImagePreviewFlowLayout.h"
11 |
12 | @implementation ImagePickerCollectionView
13 |
14 | - (instancetype)init
15 | {
16 | self = [super initWithFrame:CGRectZero collectionViewLayout:[[ImagePreviewFlowLayout alloc] init]];
17 | if (self) {
18 | [self initialize];
19 | }
20 | return self;
21 | }
22 |
23 | - (id)initWithCoder:(NSCoder *)aDecoder
24 | {
25 | self = [super initWithCoder:aDecoder];
26 | if (self) {
27 | [self initialize];
28 | }
29 | return self;
30 | }
31 |
32 | - (void)initialize
33 | {
34 |
35 | }
36 |
37 | - (ImagePreviewFlowLayout *)imagePreviewLayout
38 | {
39 | return (ImagePreviewFlowLayout *)self.collectionViewLayout;
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImagePickerSheetViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ImagePickerSheetViewController.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/7.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @class ImagePickerSheetViewController, LFImagePickerController, LFResultObject;
13 |
14 | @protocol ImagePickerSheetViewControllerDelegate
15 | @optional
16 | /* 即将显示 */
17 | - (void)imagePickerSheetViewControllerWillBeginShow:(ImagePickerSheetViewController *)imagePickerSheet;
18 | /* 完全显示 */
19 | - (void)imagePickerSheetViewControllerDidBeginShow:(ImagePickerSheetViewController *)imagePickerSheet;
20 | /* 即将关闭 */
21 | - (void)imagePickerSheetViewControllerWillEndShow:(ImagePickerSheetViewController *)imagePickerSheet;
22 | /* 完全关闭 */
23 | - (void)imagePickerSheetViewControllerDidEndShow:(ImagePickerSheetViewController *)imagePickerSheet;
24 |
25 | /** 发送3 */
26 | - (void)imagePickerSheetViewControllerResultImages:(NSArray *)resultImages;
27 | /** 取消 */
28 | - (void)imagePickerSheetViewControllerDidCancel:(ImagePickerSheetViewController *)imagePickerSheet;
29 |
30 |
31 | /** 拍照发送 注:也可以实现imagePickerSheetVCPhotoSendImageBlock回调*/
32 | - (void)imagePickerSheetViewControllerPhotoImage:(UIImage *)image;
33 | /** 相册 */
34 | - (void)imagePickerSheetViewControllerOpenPhotoLabrary;
35 | /** 拍照 */
36 | - (void)imagePickerSheetViewControllerTakePhoto;
37 | /** 超过最大选择 */
38 | - (void)imagePickerSheetViewControllerDidMaximum:(NSInteger)maximum;
39 |
40 | #pragma mark - Deprecated
41 | /** 发送(直接回调PHAsset或ALAsset对象) */
42 | - (void)imagePickerSheetViewControllerAssets:(NSArray *)assets __deprecated_msg("Method deprecated. Use `imagePickerSheetViewControllerResultImages:`");
43 |
44 | /** 发送2(compressImgs缩略图组,originalImgs原图组或者标清)注:也可以实现imagePickerSheetVCSendImageBlock回调 */
45 | - (void)imagePickerSheetViewControllerThumbnailImages:(NSArray *)compressImgs originalImages:(NSArray *)originalImgs __deprecated_msg("Method deprecated. Use `imagePickerSheetViewControllerResultImages:`");
46 | - (void)imagePickerSheetViewControllerThumbnailImages:(NSArray *)compressImgs originalImages:(NSArray *)originalImgs infos:(NSArray *)infos __deprecated_msg("Method deprecated. Use `imagePickerSheetViewControllerResultImages:`");
47 |
48 | @end
49 |
50 | @interface ImagePickerSheetViewController : UIViewController
51 |
52 | /** 首次显示缩放动画 默认NO */
53 | @property (nonatomic, assign) BOOL zoomAnimited;
54 |
55 | @property (nonatomic, assign) id delegate;
56 |
57 | @property (nonatomic, copy) void(^imagePickerSheetVCSendResultImageBlock)(NSArray * resultImages);
58 | /** 拍照发送,回调回图片 */
59 | @property (nonatomic, copy) void (^imagePickerSheetVCPhotoSendImageBlock)(UIImage *image);
60 | /** 取消 */
61 | @property (nonatomic, copy) void (^imagePickerSheetVCCancel)(void);
62 | /** 最大选择数量 */
63 | @property (nonatomic, assign) NSInteger maximumNumberOfSelection;
64 | /** 显示相册数量,默认20,设置0为全部 */
65 | @property (nonatomic, assign) NSUInteger fetchLimit;
66 |
67 | /** 使用内置相册回调->设置属性 */
68 | @property (nonatomic, copy) void (^photoLabrary)(LFImagePickerController *lf_imagePicker);
69 | /** 销毁回调 */
70 | @property (nonatomic, copy) void (^dismissBlock)(void) __deprecated_msg("Block deprecated. Use `imagePickerSheetViewControllerDidEndShow`");
71 |
72 | - (void)showImagePickerInController:(UIViewController *)controller animated:(BOOL)animated;
73 |
74 |
75 | #pragma mark - Deprecated
76 | @property (nonatomic, copy) void(^imagePickerSheetVCSendAssetBlock)(NSArray *assets) __deprecated_msg("Block deprecated. Use `imagePickerSheetVCSendResultImageBlock`");
77 | /** 发送图片block,回调回两组数组,一组压缩图片数组,一组原图数组 */
78 | @property (nonatomic, copy) void(^imagePickerSheetVCSendImageBlock)(NSArray *thumbnailImages, NSArray *originalImages) __deprecated_msg("Block deprecated. Use `imagePickerSheetVCSendResultImageBlock`");
79 | @property (nonatomic, copy) void(^imagePickerSheetVCSendImageWithInfoBlock)(NSArray *thumbnailImages, NSArray *originalImages, NSArray *infos) __deprecated_msg("Block deprecated. Use `imagePickerSheetVCSendResultImageBlock`");
80 |
81 |
82 | @end
83 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImagePreviewFlowLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCollectionViewFlowLayout.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/8.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ImagePreviewFlowLayout : UICollectionViewFlowLayout
12 |
13 | @property (nonatomic, assign) BOOL showSupplementaryViews;
14 |
15 | @property (nonatomic, strong) NSIndexPath *invalidationCenteredIndexPath;
16 | @end
17 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImageTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // ImageTableViewCell.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/10.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 | @class ImagePickerCollectionView;
11 |
12 | @interface ImageTableViewCell : UITableViewCell
13 | /** 重用标识 */
14 | + (NSString *)identifier;
15 | @property (nonatomic, strong) ImagePickerCollectionView *collectionView;
16 | @end
17 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImageTableViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // ImageTableViewCell.m
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/10.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import "ImageTableViewCell.h"
10 | #import "ImagePickerCollectionView.h"
11 |
12 | @implementation ImageTableViewCell
13 |
14 | + (NSString *)identifier
15 | {
16 | return NSStringFromClass([self class]);
17 | }
18 |
19 | - (void)awakeFromNib {
20 | // Initialization code
21 | [super awakeFromNib];
22 | }
23 |
24 | - (void)setCollectionView:(ImagePickerCollectionView *)collectionView
25 | {
26 | [_collectionView removeFromSuperview];
27 |
28 | _collectionView = collectionView;
29 | [self.contentView addSubview:_collectionView];
30 | }
31 |
32 | - (void)prepareForReuse
33 | {
34 | [super prepareForReuse];
35 | _collectionView = nil;
36 | }
37 |
38 | - (void)layoutSubviews
39 | {
40 | [super layoutSubviews];
41 | CGRect collectionViewRect = CGRectMake(-CGRectGetWidth(self.contentView.bounds), CGRectGetMinY(self.contentView.bounds), CGRectGetWidth(self.contentView.bounds)*3, CGRectGetHeight(self.contentView.bounds));
42 | if (!CGRectEqualToRect(collectionViewRect, _collectionView.frame)) {
43 | _collectionView.frame = collectionViewRect;
44 | _collectionView.contentInset = UIEdgeInsetsMake(0.0, CGRectGetWidth(self.contentView.bounds), 0.0, CGRectGetWidth(self.contentView.bounds));
45 | }
46 | }
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/PreviewSupplementaryView.h:
--------------------------------------------------------------------------------
1 | //
2 | // CollectionSupplementaryView.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/8.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface PreviewSupplementaryView : UICollectionReusableView
12 |
13 | @property (nonatomic, assign) BOOL selected;
14 | @property (nonatomic, assign) UIEdgeInsets buttonInset;
15 |
16 | /** 重用标识 */
17 | + (NSString *)identifier;
18 |
19 | + (UIImage *)checkmarkImage;
20 | + (UIImage *)selectedCheckmarkImage;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/PreviewSupplementaryView.m:
--------------------------------------------------------------------------------
1 | //
2 | // CollectionSupplementaryView.m
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/8.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import "PreviewSupplementaryView.h"
10 |
11 | @interface PreviewSupplementaryView ()
12 |
13 | @property (nonatomic, strong) UIButton *button;
14 |
15 | @end
16 |
17 | @implementation PreviewSupplementaryView
18 |
19 | - (instancetype)initWithFrame:(CGRect)frame
20 | {
21 | self = [super initWithFrame:frame];
22 | if (self) {
23 | [self initialize];
24 | }
25 | return self;
26 | }
27 |
28 | - (id)initWithCoder:(NSCoder *)aDecoder
29 | {
30 | self = [super initWithCoder:aDecoder];
31 | if (self) {
32 | [self initialize];
33 | }
34 | return self;
35 | }
36 |
37 | - (void)initialize
38 | {
39 | _buttonInset = UIEdgeInsetsZero;
40 | [self addSubview:self.button];
41 | }
42 |
43 | - (UIButton *)button
44 | {
45 | if (_button == nil) {
46 | _button = [[UIButton alloc] init];
47 | _button.tintColor = [UIColor whiteColor];
48 | _button.userInteractionEnabled = NO;
49 | [_button setImage:[PreviewSupplementaryView checkmarkImage] forState:UIControlStateNormal];
50 | [_button setImage:[PreviewSupplementaryView selectedCheckmarkImage] forState:UIControlStateSelected];
51 | }
52 | return _button;
53 | }
54 |
55 | /** 重用标识 */
56 | + (NSString *)identifier
57 | {
58 | return NSStringFromClass([self class]);
59 | }
60 |
61 | + (NSBundle *)imagePickerSheetBundle
62 | {
63 | static NSBundle *lf_imagePickerSheetBundle = nil;
64 | if (lf_imagePickerSheetBundle == nil) {
65 | // 这里不使用mainBundle是为了适配pod 1.x和0.x
66 | lf_imagePickerSheetBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[NSClassFromString(@"ImagePickerSheetViewController") class]] pathForResource:@"SupplementaryView" ofType:@"bundle"]];
67 | }
68 | return lf_imagePickerSheetBundle;
69 | }
70 |
71 | + (UIImage *)checkmarkImage
72 | {
73 | UIImage *image = [UIImage imageWithContentsOfFile:[[self imagePickerSheetBundle] pathForResource:@"PreviewSupplementaryView-Checkmark.png" ofType:nil]];
74 | return [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
75 | }
76 |
77 | + (UIImage *)selectedCheckmarkImage
78 | {
79 | UIImage *image = [UIImage imageWithContentsOfFile:[[self imagePickerSheetBundle] pathForResource:@"PreviewSupplementaryView-Checkmark-Selected.png" ofType:nil]];
80 | return [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
81 | }
82 |
83 | - (void)setSelected:(BOOL)selected
84 | {
85 | _selected = selected;
86 | _button.selected = selected;
87 | [self reloadButtonBackgroundColor];
88 | }
89 |
90 | - (void)reloadButtonBackgroundColor
91 | {
92 | _button.backgroundColor = _button.selected ? self.tintColor : nil;
93 | }
94 |
95 | - (void)prepareForReuse
96 | {
97 | [super prepareForReuse];
98 | self.selected = NO;
99 | }
100 |
101 | - (void)tintColorDidChange
102 | {
103 | [super tintColorDidChange];
104 | [self reloadButtonBackgroundColor];
105 | }
106 |
107 | - (void)layoutSubviews
108 | {
109 | [_button sizeToFit];
110 | CGRect buttonF = _button.frame;
111 | buttonF.origin = CGPointMake(_buttonInset.left, CGRectGetHeight(self.bounds)-CGRectGetHeight(_button.frame)-_buttonInset.bottom);
112 | _button.frame = buttonF;
113 | _button.layer.cornerRadius = CGRectGetHeight(_button.frame) / 2.0;
114 | }
115 |
116 | @end
117 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark-Selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark-Selected.png
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark-Selected@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark-Selected@2x.png
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark-Selected@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark-Selected@3x.png
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark.png
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark@2x.png
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/SupplementaryView.bundle/PreviewSupplementaryView-Checkmark@3x.png
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.miracle.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSCameraUsageDescription
26 | App 需要您的同意才能访问相机
27 | NSPhotoLibraryUsageDescription
28 | App 需要您的同意才能访问相册
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UIRequiredDeviceCapabilities
34 |
35 | armv7
36 |
37 | UISupportedInterfaceOrientations
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationLandscapeLeft
41 | UIInterfaceOrientationLandscapeRight
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/7.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/7.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "ImagePickerSheetViewController.h"
11 | #import "LFAssetManager.h"
12 | #import "LFImagePickerController.h"
13 |
14 | @interface ViewController ()
15 | {
16 | UITapGestureRecognizer *singleTapRecognizer;
17 | }
18 | @end
19 |
20 | @implementation ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 | // Do any additional setup after loading the view, typically from a nib.
25 | /** 单击的 Recognizer */
26 | singleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singlePressed:)];
27 | /** 点击的次数 */
28 | singleTapRecognizer.numberOfTapsRequired = 1; // 单击
29 | /** 给view添加一个手势监测 */
30 | singleTapRecognizer.enabled = YES;
31 | [self.view addGestureRecognizer:singleTapRecognizer];
32 |
33 | /** 触发允许使用照片 */
34 | // [[LFAssetManager manager].assetLibrary enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos
35 | // usingBlock:nil
36 | // failureBlock:nil];
37 | }
38 |
39 | - (void)viewWillAppear:(BOOL)animated
40 | {
41 | [super viewWillAppear:animated];
42 | // singleTapRecognizer.enabled = YES;
43 | }
44 |
45 | - (void)viewWillDisappear:(BOOL)animated
46 | {
47 | [super viewWillDisappear:animated];
48 | // singleTapRecognizer.enabled = NO;
49 | }
50 |
51 | - (void)didReceiveMemoryWarning {
52 | [super didReceiveMemoryWarning];
53 | // Dispose of any resources that can be recreated.
54 | }
55 |
56 | - (void)singlePressed:(UITapGestureRecognizer *)sender
57 | {
58 | NSLog(@"启动图片选择器");
59 | ImagePickerSheetViewController *imagePicker = [[ImagePickerSheetViewController alloc] init];
60 | imagePicker.delegate = self;
61 | imagePicker.zoomAnimited = YES;
62 | imagePicker.photoLabrary = ^(LFImagePickerController *lf_imagePicker) {
63 | // lf_imagePicker.allowTakePicture = NO;
64 | // lf_imagePicker.allowPickingVideo = NO;
65 | lf_imagePicker.doneBtnTitleStr = @"发送";
66 | };
67 | [imagePicker showImagePickerInController:self animated:YES];
68 | }
69 |
70 | //- (void)imagePickerSheetViewControllerOpenPhotoLabrary
71 | //{
72 | // NSLog(@"打开第三方框架");
73 | //}
74 |
75 | - (void)imagePickerSheetViewControllerPhotoImage:(UIImage *)image
76 | {
77 | NSLog(@"%@", image);
78 | }
79 |
80 | - (void)imagePickerSheetViewControllerResultImages:(NSArray *)resultImages
81 | {
82 | NSLog(@"%@", resultImages);
83 | }
84 | /** 取消 */
85 | - (void)imagePickerSheetViewControllerDidCancel:(ImagePickerSheetViewController *)imagePickerSheet
86 | {
87 | NSLog(@"cancel");
88 | }
89 |
90 | @end
91 |
--------------------------------------------------------------------------------
/ImagePickerSheet/ImagePickerSheet/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // ImagePickerSheet
4 | //
5 | // Created by LamTsanFeng on 15/7/7.
6 | // Copyright (c) 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ImagePickerSheetViewController.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'ImagePickerSheetViewController'
3 | s.version = '1.1.4'
4 | s.summary = 'image picker'
5 | s.homepage = 'https://github.com/lincf0912/ImagePickerSheetViewController'
6 | s.license = 'MIT'
7 | s.author = { 'lincf0912' => 'dayflyking@163.com' }
8 | s.platform = :ios
9 | s.ios.deployment_target = '7.0'
10 | s.source = { :git => 'https://github.com/lincf0912/ImagePickerSheetViewController.git', :tag => s.version, :submodules => true }
11 | s.requires_arc = true
12 | s.resources = 'ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/*.bundle'
13 | s.source_files = 'ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/*.{h,m}'
14 | s.public_header_files = 'ImagePickerSheet/ImagePickerSheet/ImagePickerSheetViewController/ImagePickerSheetViewController.h'
15 | s.dependency 'LFImagePickerController'
16 |
17 | end
18 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 lincf0912
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | project './ImagePickerSheet/ImagePickerSheet.xcodeproj'
5 |
6 | platform :ios, '7.0'
7 |
8 | inhibit_all_warnings!
9 |
10 | target 'ImagePickerSheet' do
11 | use_frameworks!
12 | pod 'LFImagePickerController'
13 | #pod 'LFImagePickerController/LFMediaEdit'
14 | end
15 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - LFAssetExportSession (1.0.2)
3 | - LFImagePickerController (1.7.3.2):
4 | - LFImagePickerController/Core (= 1.7.3.2)
5 | - LFImagePickerController/Core (1.7.3.2):
6 | - LFAssetExportSession
7 | - LFImagePickerController/LFGifPlayer
8 | - LFImagePickerController/LFToGIF
9 | - LFImagePickerController/LFGifPlayer (1.7.3.2)
10 | - LFImagePickerController/LFToGIF (1.7.3.2)
11 |
12 | DEPENDENCIES:
13 | - LFImagePickerController
14 |
15 | SPEC REPOS:
16 | trunk:
17 | - LFAssetExportSession
18 | - LFImagePickerController
19 |
20 | SPEC CHECKSUMS:
21 | LFAssetExportSession: bd22818d071a842fd594a72f188321a91ba13f0d
22 | LFImagePickerController: 8555536985af7b80167476cf267824f69102da62
23 |
24 | PODFILE CHECKSUM: f6fb2f87c1fdaa6e3acd757765998cbb92c047bb
25 |
26 | COCOAPODS: 1.9.3
27 |
--------------------------------------------------------------------------------
/Pods/LFAssetExportSession/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Lam
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Pods/LFAssetExportSession/README.md:
--------------------------------------------------------------------------------
1 | # LFAssetExportSession
2 | 视频压缩(体积小,清晰度高)
3 |
4 | * 可压缩预设(240p、360p、480p、720p、1080p、2k、4k)。
5 | * 更多进阶压缩方案,可设置videoSettings来实现。
6 | * 框架头文件好像很复杂。实际上调用非常简单。
7 |
8 | ````
9 | // 可选压缩预设
10 | LFAssetExportSession *encoder = [LFAssetExportSession exportSessionWithAsset:asset preset:LFAssetExportSessionPreset720P];
11 | encoder.outputFileType = AVFileTypeMPEG4;
12 | encoder.outputURL = outPath; // 视频输出路径
13 |
14 | [encoder exportAsynchronouslyWithCompletionHandler:^
15 | {
16 | if (encoder.status == AVAssetExportSessionStatusCompleted)
17 | {
18 |
19 | NSLog(@"Video export succeeded. video path:%@", encoder.outputURL);
20 | }
21 | else if (encoder.status == AVAssetExportSessionStatusCancelled)
22 | {
23 | NSLog(@"Video export cancelled");
24 | }
25 | else
26 | {
27 | NSLog(@"Video export failed with error: %@ (%ld)", encoder.error.localizedDescription, (long)encoder.error.code);
28 | }
29 | }];
30 | ````
31 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/LFImagePickerController.strings:
--------------------------------------------------------------------------------
1 | /*
2 | LFImagePickerController.strings
3 | LFImagePickerController
4 |
5 | Created by Mr.D on 2018/3/9.
6 | Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | */
8 |
9 | /* -------- LFLayoutPickerController -------*/
10 | "_doneBtnTitleStr" = "完成";
11 | "_cancelBtnTitleStr" = "取消";
12 | "_previewBtnTitleStr" = "预览";
13 | "_editBtnTitleStr" = "编辑";
14 | "_fullImageBtnTitleStr" = "原图";
15 | "_settingBtnTitleStr" = "设置";
16 | "_processHintStr" = "正在处理...";
17 | "_discardTitleStr" = "放弃操作";
18 |
19 |
20 | "_alertViewCancelTitle" = "确定";
21 | "_noDefaultAlbumName" = "指定的相册\"%@\"不存在";
22 | "_maxSelectVideoTipText_minute" = "不能选择超过%d分钟的视频";
23 | "_maxSelectVideoTipText_second" = "不能选择超过%d秒的视频";
24 | "_maxSelectPhotoTipText" = "你最多只能选择%zd张照片";
25 | "_maxSelectVideoTipText" = "你最多只能选择%zd个视频";
26 | "_minSelectPhotoTipText" = "请至少选择%zd张照片";
27 | "_minSelectVideoTipText" = "请至少选择%zd个视频";
28 | "_selectPhotoSizeLimitTipText" = "图片过大,无法发送原图";
29 | "_mixedSelectionTipText_photo" = "选择视频时不能选择图片";
30 | "_mixedSelectionTipText_video" = "选择图片时不能选择视频";
31 | "_navigationBarBackTitle" = "返回";
32 |
33 |
34 | "_photoLibraryAuthorityTipText" = "请在\"设置-隐私-照片\"选项中\r允许%@访问相册";
35 | "_cameraLibraryAuthorityTipText" = "请在\"设置-隐私-相机\"中允许%@访问相机";
36 | "_audioLibraryAuthorityTipText" = "请在\"设置-隐私-麦克风\"中允许%@访问麦克风";
37 | "_cameraLibraryAuthorityCancelTitle" = "设置";
38 | "_PrivacyAuthorityJumpTipText" = "无法跳转到隐私设置页面,请手动前往设置页面,谢谢";
39 | "_PrivacyAuthorityJumpCancelTitle" = "抱歉";
40 | "_cameraTakePhotoError" = "拍照错误";
41 | "_cameraTakeVideoError" = "拍摄错误";
42 |
43 | /* -------- LFPhotoPickerController -------*/
44 | "_LFPhotoPickerController_noMediaTipText" = "没有图片或视频";
45 | "_LFPhotoPickerController_noPhotoTipText" = "没有图片";
46 | "_LFPhotoPickerController_noVideoTipText" = "没有视频";
47 | "_LFPhotoPickerController_buttonTipTitle" = "添加更多照片...";
48 | "_LFPhotoPickerController_photoAlbunDeletedError" = "相册已被删除!";
49 |
50 | /* -------- LFPhotoPreviewController -------*/
51 | "_LFPhotoPreviewController_EditPhotoTipText" = "未加载图片,请重试。";
52 | "_LFPhotoPreviewController_EditVideoTipText" = "未加载视频,请重试。";
53 |
54 | /* -------- LFAssetManager+SaveAlbum -------*/
55 | "_LFAssetManager_SaveAlbum_notpermissionError" = "没有权限访问相册";
56 | "_LFAssetManager_SaveAlbum_saveVideoError" = "保存视频失败";
57 |
58 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/MMVideoPreviewPlay@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/MMVideoPreviewPlay@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/MMVideoPreviewPlayHL@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/MMVideoPreviewPlayHL@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/ablum_sel@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/ablum_sel@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/album_list_img_default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/album_list_img_default@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/contacts_add_myablum@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/contacts_add_myablum@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_gif_wall@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_gif_wall@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_hor_wall@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_hor_wall@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_live_wall@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_live_wall@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_piiic_wall@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_piiic_wall@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_video_wall@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/fileicon_video_wall@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/navigationbar_back_arrow@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/navigationbar_back_arrow@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/photo_album_def@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/photo_album_def@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/photo_album_sel@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/photo_album_sel@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/photo_original_def@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/photo_original_def@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/photo_original_sel@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/photo_original_sel@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/takePicture@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/takePicture@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/titleView_arrow@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/titleView_arrow@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/video_pause@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/video_pause@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/video_play@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFImagePickerController.bundle/video_play@2x.png
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/LFLayoutPickerController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFLayoutPickerController.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #ifdef LF_MEDIAEDIT
12 | @class LFPhotoEditingController, LFVideoEditingController;
13 | #endif
14 |
15 | @interface LFLayoutPickerController : UINavigationController
16 |
17 | /// Custom photo
18 | /// 自定义图片
19 | @property (nonatomic, copy) NSString *takePictureImageName;
20 | @property (nonatomic, copy) NSString *photoSelImageName;
21 | @property (nonatomic, copy) NSString *photoDefImageName;
22 | @property (nonatomic, copy) NSString *photoOriginSelImageName;
23 | @property (nonatomic, copy) NSString *photoOriginDefImageName;
24 | @property (nonatomic, copy) NSString *videoPlayImageName;
25 | @property (nonatomic, copy) NSString *videoPauseImageName;
26 | @property (nonatomic, copy) NSString *ablumSelImageName;
27 |
28 | /// Custom appearance color
29 | /// 自定义外观颜色
30 | @property (nonatomic, strong) UIColor *oKButtonTitleColorNormal;
31 | @property (nonatomic, strong) UIColor *oKButtonTitleColorDisabled;
32 | @property (nonatomic, strong) UIColor *naviBgColor;
33 | @property (nonatomic, strong) UIColor *naviTitleColor;
34 | @property (nonatomic, strong) UIFont *naviTitleFont;
35 | @property (nonatomic, strong) UIColor *naviTipsTextColor;
36 | @property (nonatomic, strong) UIFont *naviTipsFont;
37 | @property (nonatomic, strong) UIColor *barItemTextColor;
38 | @property (nonatomic, strong) UIFont *barItemTextFont;
39 | @property (nonatomic, strong) UIColor *contentBgColor;
40 | @property (nonatomic, strong) UIColor *contentTipsTextColor;
41 | @property (nonatomic, strong) UIFont *contentTipsFont;
42 | @property (nonatomic, strong) UIColor *contentTipsTitleColorNormal;
43 | @property (nonatomic, strong) UIFont *contentTipsTitleFont;
44 | @property (nonatomic, strong) UIColor *toolbarBgColor;
45 | @property (nonatomic, strong) UIColor *toolbarTitleColorNormal;
46 | @property (nonatomic, strong) UIColor *toolbarTitleColorDisabled;
47 | @property (nonatomic, strong) UIFont *toolbarTitleFont;
48 | @property (nonatomic, strong) UIColor *previewNaviBgColor;
49 |
50 |
51 | /// Copy LFImagePickerController.strings to any location of your project and modify the corresponding value.
52 | /// These property have the highest priority and use LFImagePickerController.strings as much as possible. Otherwise, some properties of LFImagePickerController.strings will be invalid.
53 | /// 复制LFImagePickerController.strings到项目任意位置,修改对应的值。
54 | /// 这些属性拥有最高的优先级,尽可能使用LFImagePickerController.strings。否则会导致LFImagePickerController.strings对应的属性失效。
55 | @property (nonatomic, copy) NSString *doneBtnTitleStr;
56 | @property (nonatomic, copy) NSString *cancelBtnTitleStr;
57 | @property (nonatomic, copy) NSString *previewBtnTitleStr;
58 | @property (nonatomic, copy) NSString *editBtnTitleStr;
59 | @property (nonatomic, copy) NSString *fullImageBtnTitleStr;
60 | @property (nonatomic, copy) NSString *settingBtnTitleStr;
61 | @property (nonatomic, copy) NSString *processHintStr;
62 |
63 | #ifdef LF_MEDIAEDIT
64 | #pragma mark - 编辑模式/Edit model
65 | @property (nonatomic, copy) void (^photoEditLabrary)(LFPhotoEditingController *lf_photoEditingVC);
66 | @property (nonatomic, copy) void (^videoEditLabrary)(LFVideoEditingController *lf_videoEditingVC);
67 | #endif
68 |
69 | - (void)showAlertWithTitle:(NSString *)title;
70 | - (void)showAlertWithTitle:(NSString *)title complete:(void (^)(void))complete;
71 | - (void)showAlertWithTitle:(NSString *)title message:(NSString *)message complete:(void (^)(void))complete;
72 | - (void)showAlertWithTitle:(NSString *)title cancelTitle:(NSString *)cancelTitle message:(NSString *)message complete:(void (^)(void))complete;
73 |
74 | - (void)showProgressHUDText:(NSString *)text isTop:(BOOL)isTop;
75 | - (void)showProgressHUDText:(NSString *)text;
76 | - (void)showProgressHUD;
77 | - (void)hideProgressHUD;
78 |
79 | - (void)showNeedProgressHUD;
80 | - (void)setProcess:(CGFloat)process;
81 | @end
82 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFAlbumCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAlbumCell.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class LFAlbum;
12 | @interface LFAlbumCell : UITableViewCell
13 |
14 | @property (nonatomic, strong) LFAlbum *album;
15 | /** 封面 */
16 | @property (nonatomic, setter=setPosterImage:) UIImage *posterImage;
17 |
18 | /** 设置选中图片 */
19 | - (void)setSelectedImage:(UIImage *)image;
20 |
21 | + (CGFloat)cellHeight;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFAssetCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetCell.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @class LFAsset;
13 |
14 | /// 宫格图片视图
15 |
16 | @interface LFAssetCell : UICollectionViewCell
17 |
18 | @property (nonatomic, strong) LFAsset *model;
19 | @property (nonatomic, copy) void (^didSelectPhotoBlock)(BOOL isSelected, LFAsset *model, LFAssetCell *weakCell);
20 | /** 只能选中 */
21 | @property (nonatomic, assign) BOOL onlySelected;
22 | /** 只能点击;但优先级低于只能选中onlySelected */
23 | @property (nonatomic, assign) BOOL onlyClick;
24 | /** 不能选中 */
25 | @property (nonatomic, assign) BOOL noSelected;
26 |
27 | @property (nonatomic, copy) NSString *photoSelImageName;
28 | @property (nonatomic, copy) NSString *photoDefImageName;
29 |
30 | @property (nonatomic, assign) BOOL displayGif;
31 | @property (nonatomic, assign) BOOL displayLivePhoto;
32 | @property (nonatomic, assign) BOOL displayPhotoName;
33 |
34 | /** 设置选中 */
35 | - (void)selectPhoto:(BOOL)isSelected index:(NSUInteger)index animated:(BOOL)animated;
36 |
37 | @end
38 |
39 | /// 拍照视图
40 |
41 | @interface LFAssetCameraCell : UICollectionViewCell
42 |
43 | @property (nonatomic, copy) UIImage *posterImage;
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFPhotoPreviewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPreviewCell.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/14.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol LFPhotoPreviewCellDelegate;
12 |
13 | @class LFAsset;
14 | @interface LFPhotoPreviewCell : UICollectionViewCell
15 |
16 | @property (nonatomic, strong) LFAsset *model;
17 | @property (nonatomic, weak) id delegate;
18 |
19 | /** 当前展示的图片 */
20 | @property (nonatomic, readonly) UIImage *previewImage;
21 |
22 | // 即将显示
23 | - (void)willDisplayCell;
24 | // 正式显示
25 | - (void)didDisplayCell;
26 | // 即将消失
27 | - (void)willEndDisplayCell;
28 | // 正式消失
29 | - (void)didEndDisplayCell;
30 |
31 |
32 | /** 子类重写 */
33 | /** 创建显示视图 */
34 | - (UIView *)subViewInitDisplayView;
35 | /** 重置视图 */
36 | - (void)subViewReset;
37 | /** 设置数据 */
38 | - (void)subViewSetModel:(LFAsset *)model completeHandler:(void (^)(id data,NSDictionary *info,BOOL isDegraded))completeHandler progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler;
39 | @end
40 |
41 | @protocol LFPhotoPreviewCellDelegate
42 | @optional
43 | - (void)lf_photoPreviewCellSingleTapHandler:(LFPhotoPreviewCell *)cell;
44 | @end
45 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFPhotoPreviewCell_property.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPreviewCell_property.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/6/1.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFPhotoPreviewCell.h"
10 |
11 | @interface LFPhotoPreviewCell ()
12 |
13 | @property (nonatomic, readonly) UIImageView *imageView;
14 | @property (nonatomic, readonly) UIScrollView *scrollView;
15 | @property (nonatomic, readonly) UIView *imageContainerView;
16 |
17 | @property (nonatomic, readonly) UITapGestureRecognizer *tap1;
18 | @property (nonatomic, readonly) UITapGestureRecognizer *tap2;
19 |
20 | @property (nonatomic, readwrite) UIImage *previewImage;
21 |
22 | @property (nonatomic, assign) BOOL isFinalData;
23 |
24 | /** 重置视图 */
25 | - (void)resizeSubviews;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFPhotoPreviewGifCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPreviewGifCell.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/6/1.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFPhotoPreviewCell.h"
10 |
11 | @interface LFPhotoPreviewGifCell : LFPhotoPreviewCell
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFPhotoPreviewGifCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPreviewGifCell.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/6/1.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFPhotoPreviewGifCell.h"
10 | #import "LFPhotoPreviewCell_property.h"
11 | #import "LFAssetManager.h"
12 |
13 | #import "LFGifPlayerManager.h"
14 | #import "UIImage+LF_Format.h"
15 |
16 | @interface LFPhotoPreviewGifCell ()
17 |
18 | @property (nonatomic, strong) NSData *imageData;
19 | @property (nonatomic, assign) CGFloat imageWidth;
20 | @property (nonatomic, assign) CGFloat imageHeight;
21 |
22 | @property (nonatomic, assign) BOOL waitForReadyToPlay;
23 |
24 | @end
25 |
26 | @implementation LFPhotoPreviewGifCell
27 |
28 |
29 | - (UIImage *)previewImage
30 | {
31 | if (self.imageData) {
32 | return [UIImage LF_imageWithImageData:self.imageData];
33 | }
34 | return nil;
35 | }
36 |
37 | - (void)setPreviewImage:(UIImage *)previewImage
38 | {
39 | [super setPreviewImage:previewImage];
40 | [self.imageView startAnimating];
41 | }
42 |
43 | /** 图片大小 */
44 | - (CGSize)subViewImageSize
45 | {
46 | if (self.imageWidth && self.imageHeight) {
47 | return CGSizeMake(self.imageWidth, self.imageHeight);
48 | }
49 | return self.imageView.image.size;
50 | }
51 |
52 | /** 重置视图 */
53 | - (void)subViewReset
54 | {
55 | [super subViewReset];
56 | self.imageData = nil;
57 | [[LFGifPlayerManager shared] stopGIFWithKey:[NSString stringWithFormat:@"%zd", [self.model hash]]];
58 | }
59 | /** 设置数据 */
60 | - (void)subViewSetModel:(LFAsset *)model completeHandler:(void (^)(id data,NSDictionary *info,BOOL isDegraded))completeHandler progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler
61 | {
62 | if (model.subType == LFAssetSubMediaTypeGIF) { /** GIF图片处理 */
63 | // 先获取缩略图
64 | PHImageRequestID imageRequestID = [[LFAssetManager manager] getPhotoWithAsset:model.asset photoWidth:self.bounds.size.width completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
65 | if (completeHandler) {
66 | completeHandler(photo, info, YES);
67 | }
68 | }];
69 | // 获取原图
70 | [[LFAssetManager manager] getPhotoDataWithAsset:model.asset completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) {
71 |
72 | if ([model isEqual:self.model]) {
73 |
74 | [[LFAssetManager manager] cancelImageRequest:imageRequestID];
75 |
76 | if (self.waitForReadyToPlay) {
77 | self.waitForReadyToPlay = NO;
78 | NSString *modelKey = [NSString stringWithFormat:@"%zd", [self.model hash]];
79 | [[LFGifPlayerManager shared] transformGifDataToSampBufferRef:data key:modelKey execution:^(CGImageRef imageData, NSString *key) {
80 | if ([modelKey isEqualToString:key]) {
81 | self.imageView.layer.contents = (__bridge id _Nullable)(imageData);
82 | }
83 | } fail:^(NSString *key) {
84 | }];
85 | }
86 | self.imageData = data;
87 | // gif
88 | if(data.length > 9) {
89 | // gif 6~9 位字符代表尺寸
90 | short w1 = 0, w2 = 0;
91 | [data getBytes:&w1 range:NSMakeRange(6, 1)];
92 | [data getBytes:&w2 range:NSMakeRange(7, 1)];
93 | short w = w1 + (w2 << 8);
94 | short h1 = 0, h2 = 0;
95 | [data getBytes:&h1 range:NSMakeRange(8, 1)];
96 | [data getBytes:&h2 range:NSMakeRange(9, 1)];
97 | short h = h1 + (h2 << 8);
98 | self.imageWidth = w;
99 | self.imageHeight = h;
100 | }
101 | self.isFinalData = YES;
102 | /** 这个方式加载GIF内存使用非常高 */
103 | //self.previewImage = [UIImage LF_imageWithImageData:data];
104 | [self resizeSubviews]; // 刷新subview的位置。
105 | }
106 |
107 | } progressHandler:progressHandler networkAccessAllowed:YES];
108 | } else {
109 | [super subViewSetModel:model completeHandler:completeHandler progressHandler:progressHandler];
110 | }
111 | }
112 |
113 | - (void)didDisplayCell
114 | {
115 | [super didDisplayCell];
116 | if (self.model.subType == LFAssetSubMediaTypeGIF) { /** GIF图片处理 */
117 | if (self.imageData) {
118 | NSString *modelKey = [NSString stringWithFormat:@"%zd", [self.model hash]];
119 | if ([[LFGifPlayerManager shared] containGIFKey:modelKey]) {
120 | [[LFGifPlayerManager shared] resumeGIFWithKey:modelKey execution:^(CGImageRef imageData, NSString *key) {
121 | if ([modelKey isEqualToString:key]) {
122 | self.imageView.layer.contents = (__bridge id _Nullable)(imageData);
123 | }
124 | } fail:^(NSString *key) {
125 |
126 | }];
127 | } else {
128 | [[LFGifPlayerManager shared] transformGifDataToSampBufferRef:self.imageData key:modelKey execution:^(CGImageRef imageData, NSString *key) {
129 | if ([modelKey isEqualToString:key]) {
130 | self.imageView.layer.contents = (__bridge id _Nullable)(imageData);
131 | }
132 | } fail:^(NSString *key) {
133 | }];
134 | }
135 | } else {
136 | _waitForReadyToPlay = YES;
137 | }
138 | }
139 | }
140 |
141 | - (void)willEndDisplayCell
142 | {
143 | [super willEndDisplayCell];
144 | if (self.model.subType == LFAssetSubMediaTypeGIF) { /** GIF图片处理 */
145 | _waitForReadyToPlay = NO;
146 | [[LFGifPlayerManager shared] suspendGIFWithKey:[NSString stringWithFormat:@"%zd", [self.model hash]]];
147 | }
148 | }
149 |
150 | - (void)didEndDisplayCell
151 | {
152 | [super didEndDisplayCell];
153 | if (self.model.subType == LFAssetSubMediaTypeGIF) { /** GIF图片处理 */
154 | _waitForReadyToPlay = NO;
155 | [[LFGifPlayerManager shared] stopGIFWithKey:[NSString stringWithFormat:@"%zd", [self.model hash]]];
156 | }
157 | }
158 |
159 | @end
160 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFPhotoPreviewLivePhotoCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPreviewLivePhotoCell.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/6/1.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFPhotoPreviewCell.h"
10 |
11 | @interface LFPhotoPreviewLivePhotoCell : LFPhotoPreviewCell
12 |
13 | - (void)didPlayCell;
14 | - (void)didStopCell;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFPhotoPreviewLivePhotoCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPreviewLivePhotoCell.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/6/1.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFPhotoPreviewLivePhotoCell.h"
10 | #import "LFPhotoPreviewCell_property.h"
11 | #import "LFAssetManager.h"
12 | #import
13 |
14 | @interface LFPhotoPreviewLivePhotoCell ()
15 |
16 | @property (nonatomic, strong) PHLivePhotoView *livePhotoView;
17 |
18 | @end
19 |
20 | @implementation LFPhotoPreviewLivePhotoCell
21 |
22 | #pragma mark - 重写父类方法
23 | /** 创建显示视图 */
24 | - (UIView *)subViewInitDisplayView
25 | {
26 | if (_livePhotoView == nil) {
27 | _livePhotoView = [[PHLivePhotoView alloc] init];
28 | _livePhotoView.muted = YES;
29 | _livePhotoView.contentMode = UIViewContentModeScaleAspectFill;
30 | }
31 | return _livePhotoView;
32 | }
33 | /** 重置视图 */
34 | - (void)subViewReset
35 | {
36 | [super subViewReset];
37 | _livePhotoView.delegate = nil;
38 | [_livePhotoView stopPlayback];
39 | _livePhotoView.livePhoto = nil;
40 | }
41 |
42 | /** 图片大小 */
43 | - (CGSize)subViewImageSize
44 | {
45 | if (self.livePhotoView.livePhoto) {
46 | return self.livePhotoView.livePhoto.size;
47 | }
48 | return self.imageView.image.size;
49 | }
50 |
51 | /** 设置数据 */
52 | - (void)subViewSetModel:(LFAsset *)model completeHandler:(void (^)(id data,NSDictionary *info,BOOL isDegraded))completeHandler progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler
53 | {
54 | if (model.subType == LFAssetSubMediaTypeLivePhoto) { /** live photo */
55 | // 需要获取原图和缩略图
56 | [super subViewSetModel:model completeHandler:completeHandler progressHandler:progressHandler];
57 | // 获取livephoto
58 | [[LFAssetManager manager] getLivePhotoWithAsset:model.asset photoWidth:0 completion:^(PHLivePhoto *livePhoto, NSDictionary *info, BOOL isDegraded) {
59 |
60 | if ([model isEqual:self.model]) { /** live photo */
61 | self.livePhotoView.livePhoto = livePhoto;
62 | // if (model.closeLivePhoto == NO) {
63 | // self.livePhotoView.delegate = self;
64 | // [self.livePhotoView startPlaybackWithStyle:PHLivePhotoViewPlaybackStyleFull];
65 | // }
66 | [self resizeSubviews]; // 刷新subview的位置。
67 | }
68 |
69 | } progressHandler:progressHandler networkAccessAllowed:YES];
70 | } else {
71 | [super subViewSetModel:model completeHandler:completeHandler progressHandler:progressHandler];
72 | }
73 | }
74 |
75 | - (void)didDisplayCell
76 | {
77 | [super didDisplayCell];
78 | if (self.model.subType == LFAssetSubMediaTypeLivePhoto && self.model.closeLivePhoto == NO) { /** live photo */
79 | [self didPlayCell];
80 | }
81 | }
82 |
83 | - (void)willEndDisplayCell
84 | {
85 | [super willEndDisplayCell];
86 | if (self.model.subType == LFAssetSubMediaTypeLivePhoto) { /** live photo */
87 | [self didStopCell];
88 | }
89 | }
90 |
91 | - (void)didPlayCell
92 | {
93 | _livePhotoView.playbackGestureRecognizer.enabled = NO;
94 | _livePhotoView.delegate = self;
95 | [_livePhotoView startPlaybackWithStyle:PHLivePhotoViewPlaybackStyleFull];
96 | }
97 |
98 | - (void)didStopCell
99 | {
100 | _livePhotoView.playbackGestureRecognizer.enabled = YES;
101 | _livePhotoView.delegate = nil;
102 | [_livePhotoView stopPlayback];
103 | }
104 |
105 | #pragma mark - PHLivePhotoViewDelegate
106 | - (void)livePhotoView:(PHLivePhotoView *)livePhotoView didEndPlaybackWithStyle:(PHLivePhotoViewPlaybackStyle)playbackStyle
107 | {
108 | if (playbackStyle == PHLivePhotoViewPlaybackStyleFull) {
109 | [livePhotoView startPlaybackWithStyle:playbackStyle];
110 | }
111 | }
112 | @end
113 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/cell/LFPhotoPreviewVideoCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPreviewVideoCell.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFPhotoPreviewCell.h"
10 | #import
11 |
12 | @class LFPhotoPreviewVideoCell;
13 | @protocol LFPhotoPreviewVideoCellDelegate
14 | @optional
15 | - (void)lf_photoPreviewVideoCellDidPlayHandler:(LFPhotoPreviewVideoCell *)cell;
16 | - (void)lf_photoPreviewVideoCellDidStopHandler:(LFPhotoPreviewVideoCell *)cell;
17 | @end
18 |
19 | @interface LFPhotoPreviewVideoCell : LFPhotoPreviewCell
20 |
21 | @property (nonatomic, readonly) BOOL isPlaying;
22 | @property (nonatomic, readonly) AVAsset *asset;
23 | @property (nonatomic, weak) id delegate;
24 |
25 | - (void)didPlayCell;
26 | - (void)didPauseCell;
27 | //- (void)changeVideoPlayer:(AVAsset *)asset image:(UIImage *)image;
28 | @end
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/controller/LFBaseViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFBaseViewController.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/3/22.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LFBaseViewController : UIViewController
12 |
13 | /** 是否隐藏导航栏 默认NO */
14 | @property (nonatomic, assign) BOOL isHiddenNavBar;
15 |
16 | /** 是否隐藏状态 默认NO */
17 | @property (nonatomic, assign) BOOL isHiddenStatusBar;
18 |
19 | /** 导航栏高度+状态栏 */
20 | - (CGFloat)navigationHeight;
21 | /** 不计算导航栏的屏幕大小 */
22 | - (CGRect)viewFrameWithoutNavigation;
23 |
24 | /** 相机权限 */
25 | - (void)requestAccessForCameraCompletionHandler:(void (^)(void))handler;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/controller/LFPhotoPickerController+preview.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPickerController+preview.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2018/7/17.
6 | // Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFPhotoPickerController.h"
10 | @class LFAsset;
11 |
12 | @interface LFPhotoPickerController ()
13 |
14 | /** 图片预览模式 */
15 | - (instancetype)initWithPhotos:(NSArray *)photos completeBlock:(void (^)(void))completeBlock;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/controller/LFPhotoPickerController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPickerController.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFBaseViewController.h"
10 | @class LFAlbum,LFPhotoPreviewController;
11 |
12 | @interface LFPhotoPickerController : LFBaseViewController
13 |
14 | @property (nonatomic, strong) LFAlbum *model;
15 |
16 | - (void)pushPhotoPrevireViewController:(LFPhotoPreviewController *)photoPreviewVc;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/controller/LFPhotoPreviewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoPreviewController.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFBaseViewController.h"
10 |
11 | @protocol LFPhotoPreviewControllerPullDelegate;
12 |
13 | @class LFAsset;
14 | @interface LFPhotoPreviewController : LFBaseViewController
15 |
16 | @property (nonatomic, readonly) BOOL isPhotoPreview;
17 |
18 | /// Return the new selected photos / 返回最新的选中图片数组
19 | @property (nonatomic, copy) void (^backButtonClickBlock)(void);
20 | @property (nonatomic, copy) void (^doneButtonClickBlock)(void);
21 |
22 | /** 初始化 */
23 | - (instancetype)initWithModels:(NSArray *)models index:(NSInteger)index;
24 | /** 图片预览模式 self.isPhotoPreview=YES */
25 | - (instancetype)initWithPhotos:(NSArray *)photos index:(NSInteger)index;
26 |
27 | /** 总是显示预览框 */
28 | @property (nonatomic, assign) BOOL alwaysShowPreviewBar;
29 | /** 上一个界面的截图 */
30 | @property (nonatomic, weak) id pulldelegate;
31 |
32 |
33 | /** 3DTouch */
34 | - (void)beginPreviewing:(UINavigationController *)navi;
35 | - (void)endPreviewing;
36 |
37 | @end
38 |
39 | @protocol LFPhotoPreviewControllerPullDelegate
40 |
41 | - (UIView *)lf_PhotoPreviewControllerPullBlackgroundView;
42 |
43 | - (CGRect)lf_PhotoPreviewControllerPullItemRect:(LFAsset *)asset;
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/define/LFImagePickerController+property.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFImagePickerController+property.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2018/4/28.
6 | // Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFImagePickerController.h"
10 |
11 | @interface LFImagePickerController ()
12 |
13 | @property (nonatomic, readonly) NSMutableArray *selectedModels;
14 |
15 | @property (nonatomic, readonly) BOOL defaultSelectOriginalPhoto;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/define/LFImagePickerHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFImagePickerHeader.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/24.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LFImagePickerPublicHeader.h"
11 | #import "NSBundle+LFImagePicker.h"
12 |
13 | #define isiPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
14 | #define isiPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
15 |
16 | #define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
17 |
18 |
19 | #define dispatch_main_async_safe(block)\
20 | if ([NSThread isMainThread]) {\
21 | block();\
22 | } else {\
23 | dispatch_async(dispatch_get_main_queue(), block);\
24 | }
25 |
26 | #define dispatch_globalQueue_async_safe(block)\
27 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
28 |
29 |
30 | #define bundleImageNamed(name) [NSBundle lf_imageNamed:name]
31 |
32 | /** 视频时间(取整:四舍五入) */
33 | extern NSTimeInterval lf_videoDuration(NSTimeInterval duration);
34 | /** 是否长图 */
35 | extern BOOL lf_isPiiic(CGSize imageSize);
36 | /** 是否横图 */
37 | extern BOOL lf_isHor(CGSize imageSize);
38 |
39 | /** 标清图压缩大小 */
40 | extern float const kCompressSize;
41 | /** 缩略图压缩大小 */
42 | extern float const kThumbnailCompressSize;
43 | /** 图片最大大小 */
44 | extern float const kMaxPhotoBytes;
45 | /** 视频最大时长 */
46 | extern float const kMaxVideoDurationze;
47 |
48 | /** UIControlStateHighlighted 高亮透明度 */
49 | extern float const kControlStateHighlightedAlpha;
50 |
51 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/define/LFImagePickerHeader.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFImagePickerHeader.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/24.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFImagePickerHeader.h"
10 |
11 | /** 视频时间(取整:四舍五入) */
12 | NSTimeInterval lf_videoDuration(NSTimeInterval duration)
13 | {
14 | return (NSInteger)(duration+0.5f)*1.f;
15 | }
16 |
17 | BOOL lf_isPiiic(CGSize imageSize)
18 | {
19 | // 高度超出屏幕高度
20 | static CGFloat width = 0;
21 | if (width == 0) {
22 | width = [UIScreen mainScreen].bounds.size.width*[UIScreen mainScreen].scale;
23 | }
24 | static CGFloat height = 0;
25 | if (height == 0) {
26 | height = [UIScreen mainScreen].bounds.size.height*[UIScreen mainScreen].scale;
27 | }
28 | if (imageSize.height > height) {
29 | // 宽度大于屏幕宽度
30 | if (imageSize.width > width) {
31 | // 先比例缩放为屏幕大小的高度
32 | CGFloat height = width * imageSize.height / imageSize.width;
33 |
34 | return height > MAX(height, width);
35 | }
36 | return YES;
37 | }
38 | // 宽度小于高度的5倍
39 | return imageSize.width * 5 < imageSize.height;
40 | }
41 |
42 | BOOL lf_isHor(CGSize imageSize)
43 | {
44 | static CGFloat width = 0;
45 | if (width == 0) {
46 | width = [UIScreen mainScreen].bounds.size.width*[UIScreen mainScreen].scale;
47 | }
48 | static CGFloat height = 0;
49 | if (height == 0) {
50 | height = [UIScreen mainScreen].bounds.size.height*[UIScreen mainScreen].scale/2;
51 | }
52 | if (imageSize.width > width) {
53 | if (imageSize.height > height) {
54 | CGFloat width = height * imageSize.width / imageSize.height;
55 | return width > MAX(height, width);
56 | }
57 | return YES;
58 | }
59 | return imageSize.width > imageSize.height * 5;
60 | }
61 |
62 |
63 | /** 标清图压缩大小 */
64 | float const kCompressSize = 100.f;
65 | /** 缩略图压缩大小 */
66 | float const kThumbnailCompressSize = 10.f;
67 | /** 图片最大大小 */
68 | float const kMaxPhotoBytes = 6*1024*1024.f;
69 | /** 视频最大时长 */
70 | float const kMaxVideoDurationze = 5*60.f;
71 | /** UIControlStateHighlighted 高亮透明度 */
72 | float const kControlStateHighlightedAlpha = 0.5f;
73 |
74 | NSString *const kImageInfoFileName = @"ImageInfoFileName"; // 图片名称
75 | NSString *const kImageInfoFileSize = @"ImageInfoFileSize"; // 图片大小[长、宽]
76 | NSString *const kImageInfoFileByte = @"ImageInfoFileByte"; // 图片大小[字节]
77 | NSString *const kImageInfoFileOriginalData = @"ImageInfoFileOriginalData"; // 图片数据 原图
78 | NSString *const kImageInfoFileThumbnailData = @"ImageInfoFileThumbnailData"; // 图片数据 缩略图
79 | NSString *const kImageInfoMediaType = @"ImageInfoMediaType"; // 图片类型
80 |
81 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/define/LFImagePickerPublicHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFImagePickerPublicHeader.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/6/1.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #ifndef LFImagePickerPublicHeader_h
10 | #define LFImagePickerPublicHeader_h
11 |
12 | typedef NSString * kImageInfoFileKey NS_STRING_ENUM;
13 |
14 | /**
15 | * NSString;
16 | */
17 | extern kImageInfoFileKey const kImageInfoFileName __deprecated_msg("enum type deprecated. Use `LFReusltInfo`"); // 图片名称
18 | /**
19 | * NSValue; CGSize size;[value getValue:&size];
20 | */
21 | extern kImageInfoFileKey const kImageInfoFileSize __deprecated_msg("enum type deprecated. Use `LFReusltInfo`"); // 图片大小[长、宽]
22 | /**
23 | * NSNumber(CGFloat);
24 | */
25 | extern kImageInfoFileKey const kImageInfoFileByte __deprecated_msg("enum type deprecated. Use `LFReusltInfo`"); // 图片大小[字节]
26 | /**
27 | * NSData;
28 | */
29 | extern kImageInfoFileKey const kImageInfoFileOriginalData __deprecated_msg("enum type deprecated. Use `LFReusltImage`"); // 图片数据 原图
30 | extern kImageInfoFileKey const kImageInfoFileThumbnailData __deprecated_msg("enum type deprecated. Use `LFReusltImage`"); // 图片数据 缩略图
31 | /**
32 | * NSNumber(NSUInteger) -> LFImagePickerSubMediaType;
33 | */
34 | extern kImageInfoFileKey const kImageInfoMediaType __deprecated_msg("enum type deprecated. Use `LFReusltImage`"); // 图片类型
35 |
36 |
37 | typedef NS_ENUM(NSUInteger, LFImagePickerSubMediaType) {
38 | LFImagePickerSubMediaTypeNone = 0,
39 |
40 | LFImagePickerSubMediaTypeGIF = 10,
41 | LFImagePickerSubMediaTypeLivePhoto,
42 | };
43 |
44 | typedef NS_ENUM(NSUInteger, LFPickingMediaType) {
45 | /** None */
46 | LFPickingMediaTypeNone = 0,
47 | /** Whether the user can picking a photo */
48 | LFPickingMediaTypePhoto = 1 << 0,
49 | /** Whether the user can picking a gif */
50 | LFPickingMediaTypeGif = 1 << 1,
51 | /** Whether the user can picking a livePhoto(gif) */
52 | LFPickingMediaTypeLivePhoto = 1 << 2,
53 | /** Whether the user can picking a video */
54 | LFPickingMediaTypeVideo = 1 << 3,
55 | /** Users can picking all media types */
56 | LFPickingMediaTypeALL = ~0UL,
57 | };
58 |
59 |
60 | #endif /* LFImagePickerPublicHeader_h */
61 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/define/LFResultObject_property.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultObject__property.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFResultObject.h"
10 | #import "LFResultImage.h"
11 | #import "LFResultVideo.h"
12 |
13 | @interface LFResultObject ()
14 |
15 | /** PHAsset or ALAsset 如果系统版本大于iOS8,asset是PHAsset类的对象,否则是ALAsset类的对象 */
16 | @property (nonatomic, strong) id asset;
17 | /** 详情 */
18 | @property (nonatomic, strong) LFResultInfo *info;
19 | /** 错误 */
20 | @property (nonatomic, strong) NSError *error;
21 |
22 | @end
23 |
24 |
25 | @interface LFResultImage ()
26 |
27 | /** 缩略图 */
28 | @property (nonatomic, strong) UIImage *thumbnailImage;
29 | /** 缩略图数据 */
30 | @property (nonatomic, strong) NSData *thumbnailData;
31 | /** 原图/标清图 */
32 | @property (nonatomic, strong) UIImage *originalImage;
33 | /** 原图/标清图数据 */
34 | @property (nonatomic, strong) NSData *originalData;
35 |
36 | /** 子类型 */
37 | @property (nonatomic, assign) LFImagePickerSubMediaType subMediaType;
38 |
39 | @end
40 |
41 |
42 | @interface LFResultVideo ()
43 |
44 | /** 封面图片 */
45 | @property (nonatomic, strong) UIImage *coverImage;
46 | /** 视频数据 */
47 | @property (nonatomic, strong) NSData *data;
48 | /** 视频地址 */
49 | @property (nonatomic, strong) NSURL *url;
50 | /** 视频时长 */
51 | @property (nonatomic, assign) NSTimeInterval duration;
52 |
53 | @end
54 |
55 | @interface LFResultInfo ()
56 |
57 | /** 名称 */
58 | @property (nonatomic, copy) NSString *name;
59 | /** 大小[长、宽] */
60 | @property (nonatomic, assign) CGSize size;
61 | /** 大小[字节] */
62 | @property (nonatomic, assign) CGFloat byte;
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFAssetManager+Authorization.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetManager+Authorization.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAssetManager.h"
10 |
11 | typedef NS_ENUM(NSInteger, LFPhotoAuthorizationStatus) {
12 | /** 未询问过的 */
13 | LFPhotoAuthorizationStatusNotDetermined = 0,
14 | /** 被限制的 */
15 | LFPhotoAuthorizationStatusRestricted,
16 | /** 拒绝的 */
17 | LFPhotoAuthorizationStatusDenied,
18 | /** 允许访问所有 */
19 | LFPhotoAuthorizationStatusAuthorized,
20 | /** 允许访问部分 */
21 | LFPhotoAuthorizationStatusLimited
22 | };
23 |
24 |
25 | @interface LFAssetManager (Authorization)
26 |
27 | /// Return YES if Authorized 返回YES如果得到了授权
28 | - (BOOL)authorizationStatusAuthorized API_DEPRECATED_WITH_REPLACEMENT("-lf_authorizationStatusAndRequestAuthorization:", ios(8, API_TO_BE_DEPRECATED));
29 | - (NSInteger)authorizationStatus API_DEPRECATED_WITH_REPLACEMENT("-lf_authorizationStatus:", ios(8, API_TO_BE_DEPRECATED));
30 |
31 | - (LFPhotoAuthorizationStatus)lf_authorizationStatusAndRequestAuthorization:(void(^)(LFPhotoAuthorizationStatus status))handler;
32 | - (LFPhotoAuthorizationStatus)lf_authorizationStatus;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFAssetManager+Authorization.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetManager+Authorization.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAssetManager+Authorization.h"
10 | #import "LFImagePickerHeader.h"
11 |
12 | @implementation LFAssetManager (Authorization)
13 |
14 | /// Return YES if Authorized 返回YES如果得到了授权
15 | - (BOOL)authorizationStatusAuthorized
16 | {
17 | NSInteger status = [self authorizationStatus];
18 | if (status == 0) {
19 | /**
20 | * 当某些情况下AuthorizationStatus == AuthorizationStatusNotDetermined时,无法弹出系统首次使用的授权alertView,系统应用设置里亦没有相册的设置,此时将无法使用,故作以下操作,弹出系统首次使用的授权alertView
21 | */
22 | [self requestAuthorizationWhenNotDetermined:nil];
23 | }
24 |
25 | return status == 3;
26 | }
27 |
28 | - (LFPhotoAuthorizationStatus)lf_authorizationStatusAndRequestAuthorization:(void(^)(LFPhotoAuthorizationStatus status))handler
29 | {
30 | LFPhotoAuthorizationStatus status = [self lf_authorizationStatus];
31 | if (status == LFPhotoAuthorizationStatusNotDetermined) {
32 | /**
33 | * 当某些情况下AuthorizationStatus == AuthorizationStatusNotDetermined时,无法弹出系统首次使用的授权alertView,系统应用设置里亦没有相册的设置,此时将无法使用,故作以下操作,弹出系统首次使用的授权alertView
34 | */
35 | [self requestAuthorizationWhenNotDetermined:handler];
36 | }
37 |
38 |
39 | return status;
40 | }
41 |
42 | - (NSInteger)authorizationStatus {
43 | if (@available(iOS 14, *)) {
44 | return [PHPhotoLibrary authorizationStatusForAccessLevel:PHAccessLevelReadWrite];
45 | }
46 | else
47 | if (@available(iOS 8.0, *)){
48 | return [PHPhotoLibrary authorizationStatus];
49 | }
50 | else {
51 | return [ALAssetsLibrary authorizationStatus];
52 | }
53 | return NO;
54 | }
55 |
56 | - (LFPhotoAuthorizationStatus)lf_authorizationStatus {
57 | if (@available(iOS 14, *)) {
58 | return (LFPhotoAuthorizationStatus)[PHPhotoLibrary authorizationStatusForAccessLevel:PHAccessLevelReadWrite];
59 | }
60 | else
61 | if (@available(iOS 8.0, *)){
62 | return (LFPhotoAuthorizationStatus)[PHPhotoLibrary authorizationStatus];
63 | }
64 | else {
65 | return (LFPhotoAuthorizationStatus)[ALAssetsLibrary authorizationStatus];
66 | }
67 | return LFPhotoAuthorizationStatusNotDetermined;
68 | }
69 |
70 | //AuthorizationStatus == AuthorizationStatusNotDetermined 时询问授权弹出系统授权alertView
71 | - (void)requestAuthorizationWhenNotDetermined:(void(^)(LFPhotoAuthorizationStatus status))handler {
72 | if (@available(iOS 14, *)) {
73 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
74 | [PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus status) {
75 |
76 | dispatch_main_async_safe(^{
77 | if (handler) {
78 | handler((LFPhotoAuthorizationStatus)status);
79 | }
80 | });
81 | }];
82 | });
83 | }
84 | else
85 | if (@available(iOS 8.0, *)){
86 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
87 | [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
88 | dispatch_main_async_safe(^{
89 | if (handler) {
90 | handler((LFPhotoAuthorizationStatus)status);
91 | }
92 | });
93 | }];
94 | });
95 | }
96 | else {
97 | [self.assetLibrary enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
98 | } failureBlock:nil];
99 | }
100 | }
101 | @end
102 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFAssetManager+CreateMedia.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetManager+CreateMedia.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/9/5.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAssetManager.h"
10 |
11 | @interface LFAssetManager (CreateMedia)
12 |
13 |
14 | /**
15 | Create Gif
16 |
17 | @param images The array must contain UIImages
18 | @param size image size
19 | @param duration Provides an estimate of the maximum duration of exported media
20 | @param loopCount loop count
21 | @param error error message
22 | @return image Data
23 | */
24 | - (NSData *)createGifDataWithImages:(NSArray *)images
25 | size:(CGSize)size
26 | duration:(NSTimeInterval)duration
27 | loopCount:(NSUInteger)loopCount
28 | error:(NSError **)error;
29 |
30 | /**
31 | Create Gif
32 |
33 | @param images The array must contain UIImages
34 | @param duration Provides an estimate of the maximum duration of exported media
35 | @param loopCount loop count
36 | @param error error message
37 | @return image Data
38 | */
39 | - (NSData *)createGifDataWithImages:(NSArray *)images
40 | duration:(NSTimeInterval)duration
41 | loopCount:(NSUInteger)loopCount
42 | error:(NSError **)error;
43 |
44 | /**
45 | Create Gif
46 |
47 | @param images The array must contain UIImages
48 | @param size image size
49 | @param duration Provides an estimate of the maximum duration of exported media
50 | @param loopCount loop count
51 | @param error error message
52 | @return image
53 | */
54 | - (UIImage *)createGifWithImages:(NSArray *)images
55 | size:(CGSize)size
56 | duration:(NSTimeInterval)duration
57 | loopCount:(NSUInteger)loopCount
58 | error:(NSError **)error;
59 |
60 | /**
61 | Create Gif
62 |
63 | @param images The array must contain UIImages
64 | @param duration Provides an estimate of the maximum duration of exported media
65 | @param loopCount loop count
66 | @param error error message
67 | @return image
68 | */
69 | - (UIImage *)createGifWithImages:(NSArray *)images
70 | duration:(NSTimeInterval)duration
71 | loopCount:(NSUInteger)loopCount
72 | error:(NSError **)error;
73 |
74 |
75 |
76 | /**
77 | Create MP4
78 |
79 | @param images The array must contain UIImages
80 | @param size Video image size
81 | @param fps The image frames per second (30.fps)
82 | @param duration Provides an estimate of the maximum duration of exported media
83 | @param audioPath Background music
84 | @param complete data and error message
85 | */
86 | - (void)createMP4WithImages:(NSArray *)images
87 | size:(CGSize)size
88 | fps:(NSUInteger)fps
89 | duration:(NSTimeInterval)duration
90 | audioPath:(NSString *)audioPath
91 | complete:(void (^)(NSData *data, NSError *error))complete;
92 |
93 | /**
94 | Create MP4
95 |
96 | @param images The array must contain UIImages
97 | @param size Video image size
98 | @param audioPath Background music
99 | @param complete data and error message
100 | */
101 | - (void)createMP4WithImages:(NSArray *)images
102 | size:(CGSize)size
103 | audioPath:(NSString *)audioPath
104 | complete:(void (^)(NSData *data, NSError *error))complete;
105 |
106 | /**
107 | Create MP4
108 |
109 | @param images The array must contain UIImages
110 | @param size Video image size
111 | @param complete data and error message
112 | */
113 | - (void)createMP4WithImages:(NSArray *)images
114 | size:(CGSize)size
115 | complete:(void (^)(NSData *data, NSError *error))complete;
116 |
117 | @end
118 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFAssetManager+SaveAlbum.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetManager+SaveAlbum.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/3/24.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAssetManager.h"
10 |
11 | @interface LFAssetManager (SaveAlbum)
12 |
13 | /** 保存图片到自定义相册 */
14 | - (void)saveImageToCustomPhotosAlbumWithTitle:(NSString *)title images:(NSArray *)images complete:(void (^)(NSArray *assets,NSError *error))complete;
15 | - (void)saveImageToCustomPhotosAlbumWithTitle:(NSString *)title imageDatas:(NSArray *)imageDatas complete:(void (^)(NSArray *assets ,NSError *error))complete;
16 |
17 | /** 保存视频到自定义相册 */
18 | - (void)saveVideoToCustomPhotosAlbumWithTitle:(NSString *)title videoURLs:(NSArray *)videoURLs complete:(void(^)(NSArray *assets, NSError *error))complete;
19 |
20 | /** 删除相册中的媒体文件 */
21 | - (void)deleteAssets:(NSArray *)assets complete:(void (^)(NSError *error))complete;
22 |
23 | /** 删除相册 */
24 | - (void)deleteAssetCollections:(NSArray *)collections complete:(void (^)(NSError *error))complete NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
25 | - (void)deleteAssetCollections:(NSArray *)collections deleteAssets:(BOOL)deleteAssets complete:(void (^)(NSError *error))complete NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFAssetManager+Simple.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetManager+Simple.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2019/9/26.
6 | // Copyright © 2019 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAssetManager.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface LFAssetManager (Simple)
14 |
15 | /** 排序 YES */
16 | @property (nonatomic, assign) BOOL sortAscendingByCreateDate;
17 | /** 类型 LFPickingMediaTypeALL */
18 | @property (nonatomic, assign) LFPickingMediaType allowPickingType;
19 |
20 | /**
21 | * @author lincf, 16-07-28 17:07:38
22 | *
23 | * Get Album 获得相机胶卷相册
24 | *
25 | * @param fetchLimit 相片最大数量(IOS8之后有效)
26 | * @param completion 回调结果
27 | */
28 | - (void)getCameraRollAlbumFetchLimit:(NSInteger)fetchLimit completion:(void (^)(LFAlbum *model))completion;
29 |
30 |
31 | /**
32 | Get Album 获得所有相册/相册数组
33 |
34 | @param completion 回调结果
35 | */
36 | - (void)getAllAlbums:(void (^)(NSArray *))completion;
37 |
38 | /**
39 | * @author lincf, 16-07-28 13:07:27
40 | *
41 | * Get Assets 获得Asset数组
42 | *
43 | * @param result LFAlbum.result 相册对象
44 | * @param fetchLimit 相片最大数量
45 | * @param completion 回调结果
46 | */
47 | - (void)getAssetsFromFetchResult:(id)result fetchLimit:(NSInteger)fetchLimit completion:(void (^)(NSArray *models))completion;
48 |
49 | /** 获得下标为index的单个照片 */
50 | - (void)getAssetFromFetchResult:(id)result atIndex:(NSInteger)index completion:(void (^)(LFAsset *))completion;
51 |
52 | /// Get photo 获得照片
53 | - (void)getPostImageWithAlbumModel:(LFAlbum *)model completion:(void (^)(UIImage *postImage))completion;
54 |
55 | @end
56 |
57 | NS_ASSUME_NONNULL_END
58 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFAssetManager+Simple.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetManager+Simple.m
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2019/9/26.
6 | // Copyright © 2019 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAssetManager+Simple.h"
10 |
11 | @implementation LFAssetManager (Simple)
12 |
13 | @dynamic sortAscendingByCreateDate, allowPickingType;
14 |
15 | - (BOOL)sortAscendingByCreateDate_iOS8
16 | {
17 | /** 倒序情况下。iOS8的result已支持倒序,这里的排序应该为顺序 */
18 | BOOL ascending = self.sortAscendingByCreateDate;
19 | if (@available(iOS 8.0, *)){
20 | if (!self.sortAscendingByCreateDate) {
21 | ascending = !self.sortAscendingByCreateDate;
22 | }
23 | }
24 | return ascending;
25 | }
26 |
27 | /**
28 | * @author lincf, 16-07-28 17:07:38
29 | *
30 | * Get Album 获得相机胶卷相册
31 | *
32 | * @param fetchLimit 相片最大数量(IOS8之后有效)
33 | * @param completion 回调结果
34 | */
35 | - (void)getCameraRollAlbumFetchLimit:(NSInteger)fetchLimit completion:(void (^)(LFAlbum *model))completion
36 | {
37 | [self getCameraRollAlbum:self.allowPickingType fetchLimit:fetchLimit ascending:self.sortAscendingByCreateDate_iOS8 completion:completion];
38 | }
39 |
40 |
41 | /**
42 | Get Album 获得所有相册/相册数组
43 |
44 | @param completion 回调结果
45 | */
46 | - (void)getAllAlbums:(void (^)(NSArray *))completion
47 | {
48 | [self getAllAlbums:self.allowPickingType ascending:self.sortAscendingByCreateDate_iOS8 completion:completion];
49 | }
50 |
51 | /**
52 | * @author lincf, 16-07-28 13:07:27
53 | *
54 | * Get Assets 获得Asset数组
55 | *
56 | * @param result LFAlbum.result 相册对象
57 | * @param fetchLimit 相片最大数量
58 | * @param completion 回调结果
59 | */
60 | - (void)getAssetsFromFetchResult:(id)result fetchLimit:(NSInteger)fetchLimit completion:(void (^)(NSArray *models))completion
61 | {
62 | [self getAssetsFromFetchResult:result allowPickingType:self.allowPickingType fetchLimit:fetchLimit ascending:self.sortAscendingByCreateDate_iOS8 completion:completion];
63 | }
64 |
65 | /** 获得下标为index的单个照片 */
66 | - (void)getAssetFromFetchResult:(id)result atIndex:(NSInteger)index completion:(void (^)(LFAsset *))completion
67 | {
68 | [self getAssetFromFetchResult:result atIndex:index allowPickingType:self.allowPickingType ascending:self.sortAscendingByCreateDate_iOS8 completion:completion];
69 | }
70 |
71 | /// Get photo 获得照片
72 | - (void)getPostImageWithAlbumModel:(LFAlbum *)model completion:(void (^)(UIImage *postImage))completion
73 | {
74 | [self getPostImageWithAlbumModel:model ascending:self.sortAscendingByCreateDate_iOS8 completion:completion];
75 | }
76 | @end
77 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFPhotoEditManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPhotoEditManager.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/23.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 | #ifdef LF_MEDIAEDIT
11 |
12 | @class LFPhotoEdit, LFAsset, LFResultImage;
13 | @interface LFPhotoEditManager : NSObject
14 |
15 | + (instancetype)manager NS_SWIFT_NAME(default());
16 | + (void)free;
17 |
18 | /** 设置编辑对象 */
19 | - (void)setPhotoEdit:(LFPhotoEdit *)obj forAsset:(LFAsset *)asset;
20 | /** 获取编辑对象 */
21 | - (LFPhotoEdit *)photoEditForAsset:(LFAsset *)asset;
22 |
23 |
24 | /**
25 | * 通过asset解析缩略图、标清图/原图、图片数据字典
26 | *
27 | * @param asset LFAsset
28 | * @param isOriginal 是否原图
29 | * @param completion 返回block 顺序:缩略图、标清图、图片数据字典
30 | */
31 | - (void)getPhotoWithAsset:(LFAsset *)asset
32 | isOriginal:(BOOL)isOriginal
33 | completion:(void (^)(LFResultImage *resultImage))completion;
34 |
35 |
36 | /**
37 | 通过asset解析缩略图、标清图/原图、图片数据字典
38 |
39 | @param asset LFAsset
40 | @param isOriginal 是否原图
41 | @param compressSize 非原图的压缩大小
42 | @param thumbnailCompressSize 缩略图压缩大小
43 | @param completion 返回block 顺序:缩略图、标清图、图片数据字典
44 | */
45 | - (void)getPhotoWithAsset:(LFAsset *)asset
46 | isOriginal:(BOOL)isOriginal
47 | compressSize:(CGFloat)compressSize
48 | thumbnailCompressSize:(CGFloat)thumbnailCompressSize
49 | completion:(void (^)(LFResultImage *resultImage))completion;
50 | @end
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFVideoEditManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFVideoEditManager.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/24.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #ifdef LF_MEDIAEDIT
12 | @class LFVideoEdit, LFAsset, LFResultVideo;
13 | @interface LFVideoEditManager : NSObject
14 |
15 | + (instancetype)manager NS_SWIFT_NAME(default());
16 | + (void)free;
17 |
18 | /** 设置编辑对象 */
19 | - (void)setVideoEdit:(LFVideoEdit *)obj forAsset:(LFAsset *)asset;
20 | /** 获取编辑对象 */
21 | - (LFVideoEdit *)videoEditForAsset:(LFAsset *)asset;
22 |
23 | /**
24 | 通过asset解析视频
25 |
26 | @param asset LFAsset
27 | @param presetName 压缩预设名称 nil则默认为AVAssetExportPreset1280x720
28 | @param completion 回调
29 | */
30 | - (void)getVideoWithAsset:(LFAsset *)asset
31 | presetName:(NSString *)presetName
32 | completion:(void (^)(LFResultVideo *resultVideo))completion;
33 |
34 | @end
35 | #endif
36 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/manager/LFVideoEditManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFVideoEditManager.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/24.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #ifdef LF_MEDIAEDIT
10 | #import "LFVideoEditManager.h"
11 | #import "LFImagePickerHeader.h"
12 | #import "LFVideoEdit.h"
13 | #import "LFAsset.h"
14 | #import "LFResultObject_property.h"
15 | #import "LFAssetManager.h"
16 | #import "LF_VideoUtils.h"
17 |
18 | @interface LFVideoEditManager ()
19 |
20 | @property (nonatomic, strong) NSMutableDictionary *videoEditDict;
21 | @end
22 |
23 | @implementation LFVideoEditManager
24 |
25 | static LFVideoEditManager *manager;
26 | + (instancetype)manager {
27 | if (manager == nil) {
28 | manager = [[self alloc] init];
29 | manager.videoEditDict = [@{} mutableCopy];
30 | }
31 | return manager;
32 | }
33 |
34 | + (void)free
35 | {
36 | [manager.videoEditDict removeAllObjects];
37 | manager = nil;
38 | }
39 |
40 | /** 设置编辑对象 */
41 | - (void)setVideoEdit:(LFVideoEdit *)obj forAsset:(LFAsset *)asset
42 | {
43 | __weak typeof(self) weakSelf = self;
44 | if (asset.asset) {
45 | if (asset.name.length) {
46 | if (obj) {
47 | [weakSelf.videoEditDict setObject:obj forKey:asset.name];
48 | } else {
49 | [weakSelf.videoEditDict removeObjectForKey:asset.name];
50 | }
51 | } else {
52 | [[LFAssetManager manager] requestForAsset:asset.asset complete:^(NSString *name) {
53 | if (name.length) {
54 | if (obj) {
55 | [weakSelf.videoEditDict setObject:obj forKey:name];
56 | } else {
57 | [weakSelf.videoEditDict removeObjectForKey:name];
58 | }
59 | }
60 | }];
61 | }
62 | }
63 | }
64 | /** 获取编辑对象 */
65 | - (LFVideoEdit *)videoEditForAsset:(LFAsset *)asset
66 | {
67 | __weak typeof(self) weakSelf = self;
68 | __block LFVideoEdit *videoEdit = nil;
69 | if (asset.asset) {
70 | if (asset.name.length) {
71 | videoEdit = [weakSelf.videoEditDict objectForKey:asset.name];
72 | } else {
73 | [[LFAssetManager manager] requestForAsset:asset.asset complete:^(NSString *name) {
74 | if (name.length) {
75 | videoEdit = [weakSelf.videoEditDict objectForKey:name];
76 | }
77 | }];
78 | }
79 | }
80 | return videoEdit;
81 | }
82 |
83 |
84 | /**
85 | 通过asset解析视频
86 |
87 | @param asset LFAsset
88 | @param presetName 压缩预设名称 nil则默认为AVAssetExportPreset1280x720
89 | @param completion 回调
90 | */
91 | - (void)getVideoWithAsset:(LFAsset *)asset
92 | presetName:(NSString *)presetName
93 | completion:(void (^)(LFResultVideo *resultVideo))completion
94 | {
95 | if (presetName.length == 0) {
96 | presetName = AVAssetExportPreset1280x720;
97 | }
98 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
99 |
100 | LFVideoEdit *videoEdit = [self videoEditForAsset:asset];
101 | /** 图片文件名 */
102 | NSString *videoName = asset.name;
103 | videoName = [videoName stringByDeletingPathExtension];
104 | videoName = [[videoName stringByAppendingString:@"_Edit"] stringByAppendingPathExtension:@"mp4"];
105 |
106 | void(^VideoResultComplete)(NSString *, NSString *) = ^(NSString *path, NSString *name) {
107 |
108 | LFResultVideo *result = [LFResultVideo new];
109 | result.asset = asset.asset;
110 | result.coverImage = videoEdit.editPreviewImage;
111 | if (path.length) {
112 | NSDictionary *opts = [NSDictionary dictionaryWithObject:@(NO)
113 | forKey:AVURLAssetPreferPreciseDurationAndTimingKey];
114 | AVURLAsset *urlAsset = [[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:path] options:opts];
115 | NSData *data = [NSData dataWithContentsOfFile:path];
116 | NSTimeInterval duration = CMTimeGetSeconds(urlAsset.duration);
117 |
118 | NSArray *assetVideoTracks = [urlAsset tracksWithMediaType:AVMediaTypeVideo];
119 | CGSize size = CGSizeZero;
120 | if (assetVideoTracks.count > 0)
121 | {
122 | // Insert the tracks in the composition's tracks
123 | AVAssetTrack *track = [assetVideoTracks firstObject];
124 |
125 | CGSize dimensions = CGSizeApplyAffineTransform(track.naturalSize, track.preferredTransform);
126 | size = CGSizeMake(fabs(dimensions.width), fabs(dimensions.height));
127 | }
128 |
129 |
130 | result.data = data;
131 | result.url = [NSURL fileURLWithPath:path];
132 | result.duration = duration;
133 |
134 | LFResultInfo *info = [LFResultInfo new];
135 | result.info = info;
136 |
137 | /** 文件名 */
138 | info.name = name;
139 | /** 大小 */
140 | info.byte = data.length;
141 | /** 宽高 */
142 | info.size = size;
143 | }
144 |
145 |
146 | dispatch_async(dispatch_get_main_queue(), ^{
147 | if (completion) completion(result);
148 | });
149 | };
150 |
151 |
152 | NSString *videoPath = [[LFAssetManager CacheVideoPath] stringByAppendingPathComponent:videoName];
153 | AVAsset *av_asset = [AVURLAsset assetWithURL:videoEdit.editFinalURL];
154 | [LF_VideoUtils encodeVideoWithAsset:av_asset outPath:videoPath presetName:presetName complete:^(BOOL isSuccess, NSError *error) {
155 | if (VideoResultComplete) VideoResultComplete(videoPath, videoName);
156 | }];
157 | });
158 | }
159 | @end
160 | #endif
161 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAlbum+SmartAlbum.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAlbum+SmartAlbum.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2020/5/12.
6 | // Copyright © 2020 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAlbum.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | typedef NS_ENUM(NSUInteger, LFAlbumSmartAlbum) {
14 | LFAlbumSmartAlbumVideos = 1,
15 | LFAlbumSmartAlbumUserLibrary,
16 | LFAlbumSmartAlbumLivePhoto,
17 | LFAlbumSmartAlbumAnimated,
18 | };
19 |
20 | @interface LFAlbum (SmartAlbum)
21 |
22 | @property (nonatomic, readonly) LFAlbumSmartAlbum smartAlbum NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
23 |
24 | @end
25 |
26 | NS_ASSUME_NONNULL_END
27 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAlbum+SmartAlbum.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFAlbum+SmartAlbum.m
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2020/5/12.
6 | // Copyright © 2020 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAlbum+SmartAlbum.h"
10 | #import
11 |
12 | @implementation LFAlbum (SmartAlbum)
13 |
14 | - (LFAlbumSmartAlbum)smartAlbum
15 | {
16 | if ([self.album isKindOfClass:[PHAssetCollection class]]) {
17 | PHAssetCollection *collection = (PHAssetCollection *)self.album;
18 | if (collection.assetCollectionType == PHAssetCollectionTypeSmartAlbum) {
19 | switch (collection.assetCollectionSubtype) {
20 | case PHAssetCollectionSubtypeSmartAlbumVideos:
21 | return LFAlbumSmartAlbumVideos;
22 | case PHAssetCollectionSubtypeSmartAlbumUserLibrary:
23 | return LFAlbumSmartAlbumUserLibrary;
24 | case PHAssetCollectionSubtypeSmartAlbumLivePhotos:
25 | return LFAlbumSmartAlbumLivePhoto;
26 | case PHAssetCollectionSubtypeSmartAlbumAnimated:
27 | return LFAlbumSmartAlbumAnimated;
28 | default:
29 | break;
30 | }
31 | }
32 | }
33 | return 0;
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAlbum.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAlbum.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @class LFAsset;
13 | @interface LFAlbum : NSObject
14 |
15 | @property (nonatomic, readonly) NSString *name; ///< The album name
16 | @property (nonatomic, readonly) NSInteger count; ///< Count of photos the album contain
17 | @property (nonatomic, readonly) id result; ///< PHFetchResult or ALAssetsGroup
18 | @property (nonatomic, readonly) id album NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED; /// PHAssetCollection
19 | @property (nonatomic, strong) LFAsset *posterAsset; /** 封面对象 */
20 |
21 | /** 缓存数据 */
22 | @property (nonatomic, strong) NSArray *models;
23 |
24 | - (instancetype)initWithAlbum:(id)album result:(id)result;
25 |
26 |
27 | - (void)changedAlbum:(id /*PHAssetCollection*/)album NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
28 | - (void)changedResult:(id /*PHFetchResult*/)result NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAlbum.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFAlbum.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAlbum.h"
10 | #import "LFAsset.h"
11 | #import
12 | #import
13 |
14 | @implementation LFAlbum
15 |
16 | @synthesize count = _count;
17 |
18 | - (instancetype)initWithAlbum:(id)album result:(id)result
19 | {
20 | self = [super init];
21 | if (self) {
22 | [self changedAlbum:album];
23 | [self changedResult:result];
24 | }
25 | return self;
26 | }
27 |
28 | - (void)changedResult:(id)result
29 | {
30 | if ([result isKindOfClass:[PHFetchResult class]]) {
31 | PHFetchResult *fetchResult = (PHFetchResult *)result;
32 | _result = result;
33 | _count = fetchResult.count;
34 | } else if ([result isKindOfClass:[ALAssetsGroup class]]) {
35 | ALAssetsGroup *group = (ALAssetsGroup *)result;
36 | _result = result;
37 | _count = [group numberOfAssets];
38 | _name = [group valueForProperty:ALAssetsGroupPropertyName];
39 | }
40 | }
41 |
42 | - (void)changedAlbum:(id)album
43 | {
44 | if ([album isKindOfClass:[PHAssetCollection class]]) {
45 | PHAssetCollection *collection = (PHAssetCollection *)album;
46 | _album = album;
47 | _name = collection.localizedTitle;
48 |
49 | }
50 | }
51 |
52 | - (NSInteger)count
53 | {
54 | if (_models.count) {
55 | // 实际显示数据为准
56 | return _models.count;
57 | }
58 | return _count;
59 | }
60 |
61 | - (BOOL)isEqual:(id)object
62 | {
63 | if([self class] == [object class])
64 | {
65 | if (self == object) {
66 | return YES;
67 | }
68 | LFAlbum *objAlbum = (LFAlbum *)object;
69 | if ([self.album isEqual: objAlbum.album] && [self.name isEqual: objAlbum.name]) {
70 | return YES;
71 | }
72 | return NO;
73 | }
74 | else
75 | {
76 | return [super isEqual:object];
77 | }
78 | }
79 |
80 | @end
81 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAsset+property.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAsset+Property.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2018/5/11.
6 | // Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFAsset.h"
10 |
11 | @interface LFAsset ()
12 |
13 | @property (nonatomic, assign) NSInteger bytes;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAsset.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAsset.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LFAssetImageProtocol.h"
11 | #import "LFAssetPhotoProtocol.h"
12 | #import "LFAssetVideoProtocol.h"
13 |
14 | typedef NS_ENUM(NSUInteger, LFAssetMediaType) {
15 | LFAssetMediaTypePhoto = 0,
16 | LFAssetMediaTypeVideo,
17 | };
18 |
19 | typedef NS_ENUM(NSUInteger, LFAssetSubMediaType) {
20 | LFAssetSubMediaTypeNone = 0,
21 |
22 | /** 动图 */
23 | LFAssetSubMediaTypeGIF = 10,
24 | /** live photo */
25 | LFAssetSubMediaTypeLivePhoto,
26 |
27 | /** 全景图、横图 */
28 | LFAssetSubMediaTypePhotoPanorama = 50,
29 | /** 长图 */
30 | LFAssetSubMediaTypePhotoPiiic,
31 | };
32 |
33 | @interface LFAsset : NSObject
34 |
35 | @property (nonatomic, readonly) id asset; ///< PHAsset or ALAsset
36 | @property (nonatomic, readonly) LFAssetMediaType type;
37 | @property (nonatomic, readonly) LFAssetSubMediaType subType;
38 | @property (nonatomic, readonly) NSTimeInterval duration;
39 | @property (nonatomic, copy, readonly) NSString *name;
40 | /** 关闭livePhoto ( subType = LFAssetSubMediaTypeLivePhoto is work )default is No */
41 | @property (nonatomic, assign) BOOL closeLivePhoto;
42 |
43 |
44 | /// Init a photo dataModel With a asset
45 | /// 用一个PHAsset/ALAsset实例,初始化一个照片模型
46 | - (instancetype)initWithAsset:(id)asset;
47 |
48 |
49 | @end
50 |
51 | @interface LFAsset (preview)
52 |
53 | /** 自定义缩略图 */
54 | @property (nonatomic, readonly) UIImage *thumbnailImage;
55 | /** 自定义预览图 */
56 | @property (nonatomic, readonly) UIImage *previewImage;
57 | /** 自定义视频URL */
58 | @property (nonatomic, readonly) NSURL *previewVideoUrl;
59 |
60 |
61 | - (instancetype)initWithImage:(UIImage *)image __deprecated_msg("Method deprecated. Use `initWithObject:`");
62 | - (instancetype)initWithObject:(id/* */)asset;
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAssetImageProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetProtocol.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2018/6/27.
6 | // Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol LFAssetImageProtocol
12 |
13 | @property (nonatomic, strong) UIImage *assetImage;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAssetPhotoProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetPhotoProtocol.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2018/7/17.
6 | // Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol LFAssetPhotoProtocol
12 |
13 | @property (nonatomic, copy) NSString *name;
14 |
15 | @property (nonatomic, strong) UIImage *originalImage;
16 |
17 | @property (nonatomic, strong) UIImage *thumbnailImage;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/LFAssetVideoProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAssetVideoProtocol.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2018/7/18.
6 | // Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol LFAssetVideoProtocol
12 |
13 | @property (nonatomic, copy) NSString *name;
14 |
15 | @property (nonatomic, strong) NSURL *videoUrl;
16 |
17 | @property (nonatomic, strong) UIImage *thumbnailImage;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/result/LFResultImage.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultImage.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFResultObject.h"
10 | #import "LFImagePickerPublicHeader.h"
11 |
12 | @interface LFResultImage : LFResultObject
13 |
14 | /** 缩略图 */
15 | @property (nonatomic, readonly) UIImage *thumbnailImage;
16 | /** 缩略图数据 */
17 | @property (nonatomic, readonly) NSData *thumbnailData;
18 | /** 原图/标清图 */
19 | @property (nonatomic, readonly) UIImage *originalImage;
20 | /** 原图/标清图数据 */
21 | @property (nonatomic, readonly) NSData *originalData;
22 |
23 | /** 子类型 */
24 | @property (nonatomic, assign, readonly) LFImagePickerSubMediaType subMediaType;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/result/LFResultImage.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultImage.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFResultImage.h"
10 |
11 | @implementation LFResultImage
12 |
13 | - (void)setThumbnailImage:(UIImage *)thumbnailImage
14 | {
15 | _thumbnailImage = thumbnailImage;
16 | }
17 |
18 | - (void)setThumbnailData:(NSData *)thumbnailData
19 | {
20 | _thumbnailData = thumbnailData;
21 | }
22 |
23 | - (void)setOriginalImage:(UIImage *)originalImage
24 | {
25 | _originalImage = originalImage;
26 | }
27 |
28 | - (void)setOriginalData:(NSData *)originalData
29 | {
30 | _originalData = originalData;
31 | }
32 |
33 | - (void)setSubMediaType:(LFImagePickerSubMediaType)subMediaType
34 | {
35 | _subMediaType = subMediaType;
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/result/LFResultInfo.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultInfo.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LFResultInfo : NSObject
12 |
13 | /** 名称 */
14 | @property (nonatomic, copy, readonly) NSString *name;
15 | /** 大小[长、宽] */
16 | @property (nonatomic, assign, readonly) CGSize size;
17 | /** 大小[字节] */
18 | @property (nonatomic, assign, readonly) CGFloat byte;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/result/LFResultInfo.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultInfo.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFResultInfo.h"
10 |
11 | @implementation LFResultInfo
12 |
13 | - (void)setName:(NSString *)name
14 | {
15 | _name = name;
16 | }
17 |
18 | - (void)setSize:(CGSize)size
19 | {
20 | _size = size;
21 | }
22 |
23 | - (void)setByte:(CGFloat)byte
24 | {
25 | _byte = byte;
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/result/LFResultObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultObject.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LFResultInfo.h"
11 |
12 | @interface LFResultObject : NSObject
13 |
14 | /** PHAsset or ALAsset 如果系统版本大于iOS8,asset是PHAsset类的对象,否则是ALAsset类的对象 */
15 | @property (nonatomic, readonly) id asset;
16 | /** 详情 */
17 | @property (nonatomic, readonly) LFResultInfo *info;
18 | /** 错误 */
19 | @property (nonatomic, readonly) NSError *error;
20 |
21 | + (LFResultObject *)errorResultObject:(id)asset;
22 | @end
23 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/result/LFResultObject.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultObject.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFResultObject.h"
10 |
11 | @implementation LFResultObject
12 |
13 | - (void)setAsset:(id)asset
14 | {
15 | _asset = asset;
16 | }
17 |
18 | - (void)setInfo:(LFResultInfo *)info
19 | {
20 | _info = info;
21 | }
22 |
23 | - (void)setError:(NSError *)error
24 | {
25 | _error = error;
26 | }
27 |
28 | + (LFResultObject *)errorResultObject:(id)asset
29 | {
30 | LFResultObject *object = [[LFResultObject alloc] init];
31 | object.asset = asset;
32 | object.error = [NSError errorWithDomain:@"asset error" code:-1 userInfo:@{NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Asset:%@ cannot extract data", asset]}];
33 | return object;
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/result/LFResultVideo.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultVideo.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFResultObject.h"
10 |
11 | @interface LFResultVideo : LFResultObject
12 |
13 | /** 封面图片 */
14 | @property (nonatomic, readonly) UIImage *coverImage;
15 | /** 视频数据 */
16 | @property (nonatomic, readonly) NSData *data;
17 | /** 视频地址 */
18 | @property (nonatomic, readonly) NSURL *url;
19 | /** 视频时长 */
20 | @property (nonatomic, assign, readonly) NSTimeInterval duration;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/model/result/LFResultVideo.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFResultVideo.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/7/12.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFResultVideo.h"
10 |
11 | @implementation LFResultVideo
12 |
13 | - (void)setCoverImage:(UIImage *)coverImage
14 | {
15 | _coverImage = coverImage;
16 | }
17 |
18 | - (void)setData:(NSData *)data
19 | {
20 | _data = data;
21 | }
22 |
23 | - (void)setDuration:(NSTimeInterval)duration
24 | {
25 | _duration = duration;
26 | }
27 |
28 | - (void)setUrl:(NSURL *)url
29 | {
30 | _url = url;
31 | }
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/CancelBlock/LFCancelBlock.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFCancelBlock.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/3/17.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #ifndef LFCancelBlock_h
10 | #define LFCancelBlock_h
11 |
12 | typedef void(^lf_dispatch_cancelable_block_t)(BOOL cancel);
13 |
14 | lf_dispatch_cancelable_block_t lf_dispatch_block_t(NSTimeInterval delay, void(^block)())
15 | {
16 | __block lf_dispatch_cancelable_block_t cancelBlock = nil;
17 | lf_dispatch_cancelable_block_t delayBlcok = ^(BOOL cancel){
18 | if (!cancel) {
19 | if ([NSThread isMainThread]) {
20 | block();
21 | } else {
22 | dispatch_async(dispatch_get_main_queue(), block);
23 | }
24 | }
25 | cancelBlock = nil;
26 | };
27 | cancelBlock = delayBlcok;
28 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
29 | if (cancelBlock) {
30 | cancelBlock(NO);
31 | }
32 | });
33 | return delayBlcok;
34 | }
35 |
36 | void lf_dispatch_cancel(lf_dispatch_cancelable_block_t block)
37 | {
38 | if (block) {
39 | block(YES);
40 | }
41 | }
42 |
43 | #endif /* LFCancelBlock_h */
44 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/NSBundle+LFImagePicker.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSBundle+LFImagePicker.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2018/3/14.
6 | // Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSBundle (LFImagePicker)
12 |
13 | + (instancetype)lf_imagePickerBundle;
14 | + (UIImage *)lf_imageNamed:(NSString *)name;
15 | + (NSString *)lf_localizedStringForKey:(NSString *)key;
16 | + (NSString *)lf_localizedStringForKey:(NSString *)key value:(NSString *)value;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/NSBundle+LFImagePicker.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSBundle+LFImagePicker.m
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2018/3/14.
6 | // Copyright © 2018年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "NSBundle+LFImagePicker.h"
10 | #import "LFImagePickerController.h"
11 |
12 | NSString *const LFImagePickerStrings = @"LFImagePickerController";
13 | NSString *const LFImagePickerDrakModel = @"_Drak";
14 |
15 | @implementation NSBundle (LFImagePicker)
16 |
17 | + (instancetype)lf_imagePickerBundle
18 | {
19 | static NSBundle *lfImagePickerBundle = nil;
20 | if (lfImagePickerBundle == nil) {
21 | // 这里不使用mainBundle是为了适配pod 1.x和0.x
22 | lfImagePickerBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[LFImagePickerController class]] pathForResource:LFImagePickerStrings ofType:@"bundle"]];
23 | }
24 | return lfImagePickerBundle;
25 | }
26 |
27 | + (UIImage *)lf_imageNamed:(NSString *)name
28 | {
29 | // [UIImage imageNamed:[NSString stringWithFormat:@"%@/%@", kBundlePath, name]]
30 | NSString *extension = name.length ? (name.pathExtension.length ? name.pathExtension : @"png") : nil;
31 | NSString *defaultName = [name stringByDeletingPathExtension];
32 | NSString *bundleName = [defaultName stringByAppendingString:@"@2x"];
33 | // CGFloat scale = [UIScreen mainScreen].scale;
34 | // if (scale == 3) {
35 | // bundleName = [name stringByAppendingString:@"@3x"];
36 | // } else {
37 | // bundleName = [name stringByAppendingString:@"@2x"];
38 | // }
39 | UIImage *image = nil;
40 | if (@available(iOS 13.0, *)) {
41 | switch (UITraitCollection.currentTraitCollection.userInterfaceStyle) {
42 | case UIUserInterfaceStyleDark:
43 | {
44 | NSString *drakDefaultName = [defaultName stringByAppendingString:LFImagePickerDrakModel];
45 | NSString *drakBundleName = [drakDefaultName stringByAppendingString:@"@2x"];
46 | if (image == nil) {
47 | image = [UIImage imageWithContentsOfFile:[[self lf_imagePickerBundle] pathForResource:drakBundleName ofType:extension]];
48 | }
49 | if (image == nil) {
50 | image = [UIImage imageWithContentsOfFile:[[self lf_imagePickerBundle] pathForResource:drakDefaultName ofType:extension]];
51 | }
52 | }
53 | break;
54 | default:
55 | break;
56 | }
57 | }
58 | if (image == nil) {
59 | image = [UIImage imageWithContentsOfFile:[[self lf_imagePickerBundle] pathForResource:bundleName ofType:extension]];
60 | }
61 | if (image == nil) {
62 | image = [UIImage imageWithContentsOfFile:[[self lf_imagePickerBundle] pathForResource:defaultName ofType:extension]];
63 | }
64 | if (image == nil) {
65 | image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:name ofType:nil]];
66 | }
67 | if (image == nil) {
68 | image = [UIImage imageNamed:name];
69 | }
70 | return image;
71 | }
72 |
73 | + (NSString *)lf_localizedStringForKey:(NSString *)key
74 | {
75 | return [self lf_localizedStringForKey:key value:nil];
76 | }
77 |
78 | + (NSString *)lf_localizedStringForKey:(NSString *)key value:(NSString *)value
79 | {
80 | value = [[self lf_imagePickerBundle] localizedStringForKey:key value:value table:LFImagePickerStrings];
81 | return [[NSBundle mainBundle] localizedStringForKey:key value:value table:LFImagePickerStrings];
82 | }
83 |
84 | @end
85 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/NSString+LFExtendedStringDrawing.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+LFExtendedStringDrawing.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2020/9/29.
6 | // Copyright © 2020 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NSString (LFExtendedStringDrawing)
14 |
15 | /** 计算文字大小 */
16 | - (CGSize)lf_boundingSizeWithSize:(CGSize)size font:(UIFont *)font;
17 |
18 |
19 | - (CGSize)lf_boundingSizeWithSize:(CGSize)size attributes:(nullable NSDictionary *)attributes;
20 | - (CGSize)lf_boundingSizeWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary *)attributes;
21 | - (CGSize)lf_boundingSizeWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary *)attributes context:(nullable NSStringDrawingContext *)context;
22 |
23 | @end
24 |
25 | NS_ASSUME_NONNULL_END
26 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/NSString+LFExtendedStringDrawing.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+LFExtendedStringDrawing.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2020/9/29.
6 | // Copyright © 2020 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "NSString+LFExtendedStringDrawing.h"
10 |
11 | @implementation NSString (LFExtendedStringDrawing)
12 |
13 | - (CGSize)lf_boundingSizeWithSize:(CGSize)size font:(UIFont *)font
14 | {
15 | // 换行符
16 | NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
17 | paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
18 | return [self lf_boundingSizeWithSize:size options:NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:font, NSParagraphStyleAttributeName: paragraphStyle} context:nil];
19 | }
20 |
21 | - (CGSize)lf_boundingSizeWithSize:(CGSize)size attributes:(nullable NSDictionary *)attributes
22 | {
23 | return [self lf_boundingSizeWithSize:size options:NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading attributes:attributes context:nil];
24 | }
25 |
26 | - (CGSize)lf_boundingSizeWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary *)attributes
27 | {
28 | return [self lf_boundingSizeWithSize:size options:options attributes:attributes context:nil];
29 | }
30 |
31 | - (CGSize)lf_boundingSizeWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary *)attributes context:(nullable NSStringDrawingContext *)context
32 | {
33 | return [self boundingRectWithSize:size options:options attributes:attributes context:context].size;
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIAlertView+LF_Block.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIAlertView+Block.h
3 | // MiracleMessenger
4 | //
5 | // Created by LamTsanFeng on 15/4/3.
6 | // Copyright (c) 2015年 Anson. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void (^lf_AlertViewBlock)(UIAlertView *alertView, NSInteger buttonIndex);
12 | typedef void (^lf_AlertViewDidShowBlock)(void);
13 |
14 | @interface UIAlertView (LF_Block)
15 | //需要自定义初始化方法,调用Block
16 | /** block回调代理 */
17 | - (id)lf_initWithTitle:(NSString *)title
18 | message:(NSString *)message
19 | cancelButtonTitle:(NSString *)cancelButtonTitle
20 | otherButtonTitles:(NSString*)otherButtonTitles
21 | block:(lf_AlertViewBlock)block;
22 |
23 | /** block回调代理 弹出后回调 */
24 | - (id)lf_initWithTitle:(NSString *)title
25 | message:(NSString *)message
26 | cancelButtonTitle:(NSString *)cancelButtonTitle
27 | otherButtonTitles:(NSString*)otherButtonTitles
28 | block:(lf_AlertViewBlock)block
29 | didShowBlock:(lf_AlertViewDidShowBlock)didShowBlock;
30 |
31 | /** block回调代理 文字左对齐 */
32 | - (id)lf_initWithTitle:(NSString *)title
33 | leftMessage:(NSString *)message
34 | cancelButtonTitle:(NSString *)cancelButtonTitle
35 | otherButtonTitles:(NSString*)otherButtonTitles
36 | block:(lf_AlertViewBlock)block;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIAlertView+LF_Block.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIAlertView+Block.m
3 | // MiracleMessenger
4 | //
5 | // Created by LamTsanFeng on 15/4/3.
6 | // Copyright (c) 2015年 Anson. All rights reserved.
7 | //
8 |
9 | #import "UIAlertView+LF_Block.h"
10 | #import
11 |
12 | static char lf_overAlertViewKey;
13 | static char lf_overAlertViewKeyLeft;
14 | static char lf_overAlertViewKeyDidShow;
15 |
16 | @implementation UIAlertView (LF_Block)
17 |
18 | /** block回调代理 */
19 | - (id)lf_initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString*)otherButtonTitles block:(lf_AlertViewBlock)block
20 | {
21 | return [self lf_initWithTitle:title message:message cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitles block:block didShowBlock:nil];
22 | }
23 |
24 | /** block回调代理 弹出后回调 */
25 | - (id)lf_initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString*)otherButtonTitles block:(lf_AlertViewBlock)block didShowBlock:(lf_AlertViewDidShowBlock)didShowBlock
26 | {
27 | objc_setAssociatedObject(self, &lf_overAlertViewKey, block, OBJC_ASSOCIATION_COPY_NONATOMIC);
28 | objc_setAssociatedObject(self, &lf_overAlertViewKeyDidShow, didShowBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
29 | return [self initWithTitle:title message:message delegate:self cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitles, nil];//注意这里初始化父类的
30 | }
31 |
32 | /** block回调代理 文字左对齐 */
33 | - (id)lf_initWithTitle:(NSString *)title
34 | leftMessage:(NSString *)message
35 | cancelButtonTitle:(NSString *)cancelButtonTitle
36 | otherButtonTitles:(NSString*)otherButtonTitles
37 | block:(lf_AlertViewBlock)block
38 | {
39 | objc_setAssociatedObject(self, &lf_overAlertViewKeyLeft, @(YES), OBJC_ASSOCIATION_ASSIGN);
40 | return [self lf_initWithTitle:title message:message cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitles block:block];
41 | }
42 |
43 | #pragma mark - AlertViewDelegate
44 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
45 | //这里调用函数指针_block(要传进来的参数);
46 | lf_AlertViewBlock block = (lf_AlertViewBlock)objc_getAssociatedObject(self, &lf_overAlertViewKey);
47 | if (block) {
48 | block(alertView, buttonIndex);
49 | objc_setAssociatedObject(self, &lf_overAlertViewKey, nil, OBJC_ASSOCIATION_COPY_NONATOMIC);
50 | objc_setAssociatedObject(self, &lf_overAlertViewKeyLeft, nil, OBJC_ASSOCIATION_ASSIGN);
51 | objc_setAssociatedObject(self, &lf_overAlertViewKeyDidShow, nil, OBJC_ASSOCIATION_COPY_NONATOMIC);
52 | }
53 | }
54 |
55 | - (void)willPresentAlertView:(UIAlertView *)alertView
56 | {
57 | BOOL isCenter = [((NSNumber *)objc_getAssociatedObject(self, &lf_overAlertViewKeyLeft)) boolValue];
58 | if (isCenter == NO) return;
59 | if (([UIDevice currentDevice].systemVersion.floatValue >= 7.0f)) {
60 |
61 | NSString *message = alertView.message;
62 | // CGFloat margin = 20;
63 | // CGSize size = [message boundingRectWithSize:CGSizeMake(240-2*margin,400) options:NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading|NSStringDrawingUsesDeviceMetrics|NSStringDrawingTruncatesLastVisibleLine attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]} context:nil].size;
64 | // UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(margin, 0,240, size.height)];
65 | // textLabel.font = [UIFont systemFontOfSize:14];
66 | // textLabel.textColor = [UIColor blackColor];
67 | // textLabel.backgroundColor = [UIColor clearColor];
68 | // textLabel.lineBreakMode =NSLineBreakByWordWrapping;
69 | // textLabel.numberOfLines =0;
70 | // textLabel.textAlignment =NSTextAlignmentLeft;
71 | // textLabel.text = message;
72 | // UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, -20, 240, size.height+margin)];
73 | // [view addSubview:textLabel];
74 | UIView *view = [self lf_createView:message];
75 | [alertView setValue:view forKey:@"accessoryView"];
76 |
77 | alertView.message = @"";
78 | } else {
79 | NSInteger count = 0;
80 | for( UIView * view in alertView.subviews )
81 | {
82 | if( [view isKindOfClass:[UILabel class]] )
83 | {
84 | count ++;
85 | if ( count == 2 ) { //仅对message左对齐
86 | UILabel* label = (UILabel*) view;
87 | label.textAlignment =NSTextAlignmentLeft;
88 | }
89 | }
90 | }
91 | }
92 | }
93 |
94 | - (void)didPresentAlertView:(UIAlertView *)alertView
95 | {
96 | lf_AlertViewDidShowBlock block = (lf_AlertViewDidShowBlock)objc_getAssociatedObject(self, &lf_overAlertViewKeyDidShow);
97 | if (block) {
98 | block();
99 | }
100 | }
101 |
102 | - (UIView *)lf_createView:(NSString *)message
103 | {
104 |
105 | float textWidth = 260;
106 |
107 | float textMargin = 10;
108 |
109 | UIFont *textFont = [UIFont systemFontOfSize:15];
110 |
111 | NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
112 |
113 | attrs[NSFontAttributeName] = textFont;
114 |
115 | CGSize maxSize = CGSizeMake(textWidth-textMargin*2, MAXFLOAT);
116 |
117 | CGSize size = [message boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
118 |
119 | UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(textMargin, textMargin, textWidth, size.height)];
120 |
121 | textLabel.font = textFont;
122 |
123 | textLabel.textColor = [UIColor blackColor];
124 |
125 | textLabel.backgroundColor = [UIColor clearColor];
126 |
127 | textLabel.lineBreakMode =NSLineBreakByWordWrapping;
128 |
129 | textLabel.numberOfLines =0;
130 |
131 | textLabel.textAlignment =NSTextAlignmentLeft;
132 |
133 | textLabel.text = message;
134 |
135 | UIView *demoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, textWidth + textMargin * 2,CGRectGetMaxY(textLabel.frame)+textMargin)];
136 |
137 | [demoView addSubview:textLabel];
138 |
139 | return demoView;
140 |
141 | }
142 |
143 | @end
144 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIImage+LFCommon.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+LFCommon.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (LFCommon)
12 |
13 | /** 修正图片方向 */
14 | - (UIImage *)lf_fixOrientation;
15 |
16 | /** 根据图片大小和设置的最大宽度,返回缩放后的大小 */
17 | + (CGSize)lf_imageSizeBySize:(CGSize)size maxWidth:(CGFloat)maxWidth;
18 |
19 | /** 计算图片的缩放大小 */
20 | + (CGSize)lf_scaleImageSizeBySize:(CGSize)imageSize targetSize:(CGSize)size isBoth:(BOOL)isBoth;
21 |
22 | /** 缩放图片到指定大小 */
23 | - (UIImage*)lf_scaleToSize:(CGSize)size;
24 |
25 | /** 合并图片与文字 */
26 | + (UIImage *)lf_mergeImage:(UIImage *)image text:(NSString *)text;
27 |
28 | /*
29 | *转换成马赛克,level代表一个点转为多少level*level的正方形
30 | */
31 | - (UIImage *)lf_transToMosaicLevel:(NSUInteger)level;
32 |
33 | /** 高斯模糊 */
34 | - (UIImage *)lf_transToBlurLevel:(NSUInteger)blurRadius;
35 | @end
36 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIImage+LFDecoded.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+LFDecoded.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2020/3/5.
6 | // Copyright © 2020 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface UIImage (LFDecoded)
14 |
15 | - (UIImage *)lf_decodedImage;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIImage+LFDecoded.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+LFDecoded.m
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2020/3/5.
6 | // Copyright © 2020 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "UIImage+LFDecoded.h"
10 |
11 | @implementation UIImage (LFDecoded)
12 |
13 | - (UIImage *)lf_decodedImage
14 | {
15 | @autoreleasepool {
16 | CGImageRef imageRef = self.CGImage;
17 | if (!imageRef) return self;
18 | size_t width = CGImageGetWidth(imageRef);
19 | size_t height = CGImageGetHeight(imageRef);
20 | if (width == 0 || height == 0) return self;
21 |
22 | CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef) & kCGBitmapAlphaInfoMask;
23 | BOOL hasAlpha = NO;
24 | if (alphaInfo == kCGImageAlphaPremultipliedLast ||
25 | alphaInfo == kCGImageAlphaPremultipliedFirst ||
26 | alphaInfo == kCGImageAlphaLast ||
27 | alphaInfo == kCGImageAlphaFirst) {
28 | hasAlpha = YES;
29 | }
30 |
31 | // BGRA8888 (premultiplied) or BGRX8888
32 | CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host;
33 | bitmapInfo |= hasAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst;
34 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
35 | CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, colorSpace, bitmapInfo);
36 | CGColorSpaceRelease(colorSpace);
37 | if (!context) return self;
38 |
39 | CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); // decode
40 | CGImageRef newImageRef = CGBitmapContextCreateImage(context);
41 | CGContextRelease(context);
42 |
43 | if (!newImageRef) return self;
44 | UIImage *newImage = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:self.imageOrientation];
45 | CGImageRelease(newImageRef);
46 | return newImage;
47 | }
48 |
49 | return self;
50 | }
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIImage+LF_Format.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+Format.h
3 | // MEMobile
4 | //
5 | // Created by LamTsanFeng on 16/9/23.
6 | // Copyright © 2016年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, LFImageType) {
12 | LFImageType_Unknow = 0,
13 | LFImageType_JPEG,
14 | LFImageType_JPEG2000,
15 | LFImageType_TIFF,
16 | LFImageType_BMP,
17 | LFImageType_ICO,
18 | LFImageType_ICNS,
19 | LFImageType_GIF,
20 | LFImageType_PNG,
21 | LFImageType_WebP,
22 | };
23 |
24 | CG_EXTERN LFImageType LFImageDetectType(CFDataRef data);
25 |
26 | @interface UIImage (LF_Format)
27 |
28 | /**
29 | * @author lincf, 16-09-23 14:09:47
30 | *
31 | * 匹配加载 webp、gif、jpeg 等图片
32 | *
33 | * @param imagePath 图片路径
34 | *
35 | * @return UIImage
36 | */
37 | + (instancetype)LF_imageWithImagePath:(NSString *)imagePath;
38 |
39 | + (instancetype)LF_imageWithImagePath:(NSString *)imagePath error:(NSError **)error;
40 |
41 | + (instancetype)LF_imageWithImageData:(NSData *)imgData;
42 | @end
43 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIImage+LF_Format.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+Format.m
3 | // MEMobile
4 | //
5 | // Created by LamTsanFeng on 16/9/23.
6 | // Copyright © 2016年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import "UIImage+LF_Format.h"
10 | #import
11 |
12 | #define _FOUR_CC(c1,c2,c3,c4) ((uint32_t)(((c4) << 24) | ((c3) << 16) | ((c2) << 8) | (c1)))
13 | #define _TWO_CC(c1,c2) ((uint16_t)(((c2) << 8) | (c1)))
14 |
15 | LFImageType LFImageDetectType(CFDataRef data) {
16 | if (!data) return LFImageType_Unknow;
17 | uint64_t length = CFDataGetLength(data);
18 | if (length < 16) return LFImageType_Unknow;
19 |
20 | const char *bytes = (char *)CFDataGetBytePtr(data);
21 |
22 | uint32_t magic4 = *((uint32_t *)bytes);
23 | switch (magic4) {
24 | case _FOUR_CC(0x4D, 0x4D, 0x00, 0x2A): { // big endian TIFF
25 | return LFImageType_TIFF;
26 | } break;
27 |
28 | case _FOUR_CC(0x49, 0x49, 0x2A, 0x00): { // little endian TIFF
29 | return LFImageType_TIFF;
30 | } break;
31 |
32 | case _FOUR_CC(0x00, 0x00, 0x01, 0x00): { // ICO
33 | return LFImageType_ICO;
34 | } break;
35 |
36 | case _FOUR_CC('i', 'c', 'n', 's'): { // ICNS
37 | return LFImageType_ICNS;
38 | } break;
39 |
40 | case _FOUR_CC('G', 'I', 'F', '8'): { // GIF
41 | return LFImageType_GIF;
42 | } break;
43 |
44 | case _FOUR_CC(0x89, 'P', 'N', 'G'): { // PNG
45 | uint32_t tmp = *((uint32_t *)(bytes + 4));
46 | if (tmp == _FOUR_CC('\r', '\n', 0x1A, '\n')) {
47 | return LFImageType_PNG;
48 | }
49 | } break;
50 |
51 | case _FOUR_CC('R', 'I', 'F', 'F'): { // WebP
52 | uint32_t tmp = *((uint32_t *)(bytes + 8));
53 | if (tmp == _FOUR_CC('W', 'E', 'B', 'P')) {
54 | return LFImageType_WebP;
55 | }
56 | } break;
57 | }
58 |
59 | uint16_t magic2 = *((uint16_t *)bytes);
60 | switch (magic2) {
61 | case _TWO_CC('B', 'A'):
62 | case _TWO_CC('B', 'M'):
63 | case _TWO_CC('I', 'C'):
64 | case _TWO_CC('P', 'I'):
65 | case _TWO_CC('C', 'I'):
66 | case _TWO_CC('C', 'P'): { // BMP
67 | return LFImageType_BMP;
68 | }
69 | case _TWO_CC(0xFF, 0x4F): { // JPEG2000
70 | return LFImageType_JPEG2000;
71 | }
72 | }
73 | if (memcmp(bytes,"\377\330\377",3) == 0) return LFImageType_JPEG;
74 | if (memcmp(bytes + 4, "\152\120\040\040\015", 5) == 0) return LFImageType_JPEG2000;
75 | return LFImageType_Unknow;
76 | }
77 |
78 | @implementation UIImage (LF_Format)
79 |
80 | + (instancetype)LF_imageWithImagePath:(NSString *)imagePath
81 | {
82 | return [self LF_imageWithImagePath:imagePath error:nil];
83 | }
84 |
85 | + (instancetype)LF_imageWithImagePath:(NSString *)imagePath error:(NSError **)error
86 | {
87 | if (imagePath.length == 0) return nil;
88 | NSError *dataError = nil;
89 | NSData *imgData = [NSData dataWithContentsOfFile:imagePath options:NSDataReadingMappedIfSafe error:&dataError];
90 | if (dataError != nil) {
91 | NSLog(@"%@", dataError.localizedDescription);
92 | if (error) {
93 | *error = dataError;
94 | }
95 | return nil;
96 | }
97 |
98 | return [self LF_imageWithImageData:imgData];
99 | }
100 |
101 | + (instancetype)LF_imageWithImageData:(NSData *)imgData
102 | {
103 | LFImageType imageType = LFImageDetectType((__bridge CFDataRef)imgData);
104 |
105 | UIImage *image = nil;
106 | switch (imageType) {
107 | case LFImageType_GIF:
108 | image = [self sd_animatedGIFWithData:imgData];
109 | break;
110 | // case LFImageType_WebP:
111 | // image = [self sd_imageWithWebPData:imgData];
112 | // break;
113 | default:
114 | image = [UIImage imageWithData:imgData scale:[UIScreen mainScreen].scale];
115 | break;
116 | }
117 | return image;
118 | }
119 |
120 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data {
121 | if (!data) {
122 | return nil;
123 | }
124 |
125 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
126 |
127 | size_t count = CGImageSourceGetCount(source);
128 |
129 | UIImage *animatedImage;
130 |
131 | if (count <= 1) {
132 | animatedImage = [[UIImage alloc] initWithData:data scale:[UIScreen mainScreen].scale];
133 | }
134 | else {
135 | NSMutableArray *images = [NSMutableArray array];
136 |
137 | NSTimeInterval duration = 0.0f;
138 |
139 | for (size_t i = 0; i < count; i++) {
140 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
141 | if (!image) {
142 | continue;
143 | }
144 |
145 | duration += [self sd_frameDurationAtIndex:i source:source];
146 |
147 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]];
148 |
149 | CGImageRelease(image);
150 | }
151 |
152 | if (!duration) {
153 | duration = (1.0f / 10.0f) * count;
154 | }
155 |
156 | animatedImage = [UIImage animatedImageWithImages:images duration:duration];
157 | }
158 |
159 | CFRelease(source);
160 |
161 | return animatedImage;
162 | }
163 |
164 | + (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
165 | float frameDuration = 0.1f;
166 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
167 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
168 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary];
169 |
170 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime];
171 | if (delayTimeUnclampedProp) {
172 | frameDuration = [delayTimeUnclampedProp floatValue];
173 | }
174 | else {
175 |
176 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime];
177 | if (delayTimeProp) {
178 | frameDuration = [delayTimeProp floatValue];
179 | }
180 | }
181 |
182 | if (frameDuration < 0.011f) {
183 | frameDuration = 0.100f;
184 | }
185 |
186 | CFRelease(cfFrameProperties);
187 | return frameDuration;
188 | }
189 |
190 | @end
191 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIImage+LF_ImageCompress.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+LF_ImageCompress.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/9.
6 | // Copyright © 2017年 Miracle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (LF_ImageCompress)
12 |
13 | /** 快速压缩 压缩到大约指定体积大小(kb) 返回压缩后图片 */
14 | - (UIImage *)lf_fastestCompressImageWithSize:(CGFloat)size;
15 | - (UIImage *)lf_fastestCompressImageWithSize:(CGFloat)size imageSize:(NSUInteger)imageSize;
16 | /** 快速压缩 压缩到大约指定体积大小(kb) 返回data, 小于size指定大小,返回nil */
17 | - (NSData *)lf_fastestCompressImageDataWithSize:(CGFloat)size;
18 | - (NSData *)lf_fastestCompressImageDataWithSize:(CGFloat)size imageSize:(NSUInteger)imageSize;
19 |
20 | /** 快速压缩 压缩到大约指定体积缩放 返回压缩后图片(动图) */
21 | - (NSData *)lf_fastestCompressAnimatedImageDataWithScaleRatio:(CGFloat)ratio;
22 | @end
23 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIScrollView+LFDragAutoScroll.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIScrollView+LFDragAutoScroll.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2019/10/12.
6 | // Copyright © 2019 LamTsanFeng. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | typedef NS_ENUM(NSUInteger, LFDragAutoScrollDirection) {
15 | LFDragAutoScrollDirectionNone,
16 | LFDragAutoScrollDirectionTop,
17 | LFDragAutoScrollDirectionLeft,
18 | LFDragAutoScrollDirectionBottom,
19 | LFDragAutoScrollDirectionRight,
20 | };
21 |
22 | typedef void(^LFDragAutoScrollChanged)(CGPoint position);
23 |
24 | @interface UIScrollView (LFDragAutoScroll)
25 |
26 | /** 自动滚动的方向 */
27 | @property (nonatomic, readonly) LFDragAutoScrollDirection autoScrollDirection;
28 | /** 自动滚动的速度 默认4 越大越快 */
29 | @property (nonatomic, assign) CGFloat autoScrollSpeed;
30 |
31 | /** 自动滚动时的回调,一直滚动一直回调,跟didScroll一样 */
32 | @property (nonatomic, copy, nullable) LFDragAutoScrollChanged autoScrollChanged;
33 |
34 | /** 检查是否开启自动滚动,一般来说它是与移动视图相互配合使用 */
35 | - (BOOL)autoScrollForView:(UIView * __nullable)view;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIView+LFAnimate.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+LFAnimate.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, OscillatoryAnimationType) {
12 | OscillatoryAnimationToBigger,
13 | OscillatoryAnimationToSmaller,
14 | };
15 |
16 | @interface UIView (LFAnimate)
17 |
18 | + (void)showOscillatoryAnimationWithLayer:(CALayer *)layer type:(OscillatoryAnimationType)type;
19 | @end
20 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/Category/UIView+LFAnimate.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+LFAnimate.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/13.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "UIView+LFAnimate.h"
10 |
11 | @implementation UIView (LFAnimate)
12 |
13 | + (void)showOscillatoryAnimationWithLayer:(CALayer *)layer type:(OscillatoryAnimationType)type{
14 | NSNumber *animationScale1 = type == OscillatoryAnimationToBigger ? @(1.15) : @(0.5);
15 | NSNumber *animationScale2 = type == OscillatoryAnimationToBigger ? @(0.92) : @(1.15);
16 |
17 | [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{
18 | [layer setValue:animationScale1 forKeyPath:@"transform.scale"];
19 | } completion:^(BOOL finished) {
20 | [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{
21 | [layer setValue:animationScale2 forKeyPath:@"transform.scale"];
22 | } completion:^(BOOL finished) {
23 | [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{
24 | [layer setValue:@(1.0) forKeyPath:@"transform.scale"];
25 | } completion:nil];
26 | }];
27 | }];
28 | }
29 | @end
30 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/FileUtils/LF_FileUtility.h:
--------------------------------------------------------------------------------
1 | //
2 | // LF_FileUtility.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/9.
6 | // Copyright © 2017年 Miracle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LF_FileUtility : NSObject
12 |
13 | + (BOOL)createFile:(NSString *)path;
14 | + (BOOL)createFolder:(NSString *)path errStr:(NSString **)errStr;
15 | + (BOOL)fileExist:(NSString *)path;
16 | + (BOOL)directoryExist:(NSString *)path;
17 | + (BOOL)moveFileAtPath:(NSString *)atPath toPath:(NSString *)toPath;
18 | + (BOOL)copyFileAtPath:(NSString *)atPath toPath:(NSString *)toPath;
19 | + (BOOL)removeFile:(NSString *)path;
20 | + (void)writeLogToFile:(NSString *)filePath appendTxt:(NSString *)txt;
21 | + (u_int64_t)fileSizeForPath:(NSString *)path;
22 | + (NSArray *)findFile:(NSString *)path;
23 |
24 | /**
25 | * 根据文件大小返回文件大小字符串
26 | *
27 | * @param aSize 文件大小,单位B
28 | *
29 | * @return 文件大小字符串
30 | */
31 | + (NSString*)getFileSizeString:(float)aSize;
32 | @end
33 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/FileUtils/LF_FileUtility.m:
--------------------------------------------------------------------------------
1 | //
2 | // LF_FileUtility.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/2/9.
6 | // Copyright © 2017年 Miracle. All rights reserved.
7 | //
8 |
9 | #import "LF_FileUtility.h"
10 |
11 | @implementation LF_FileUtility
12 |
13 | + (BOOL)createFolder:(NSString *)path errStr:(NSString **)errStr
14 | {
15 | if (path.length == 0) return FALSE;
16 | NSFileManager *fileManager = [NSFileManager defaultManager];
17 | NSError *error = nil;
18 | if (![fileManager fileExistsAtPath:path]) {
19 |
20 | if (![fileManager createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]) {
21 | if (errStr) (*errStr) = [error localizedDescription];
22 | NSLog(@"createFolder error: %@ \n",[error localizedDescription]);
23 | return FALSE;
24 | }
25 | }
26 | return TRUE;
27 | }
28 |
29 | + (BOOL)createFile:(NSString *)path {
30 |
31 | NSFileManager *fileManager = [NSFileManager defaultManager];
32 | if (![fileManager fileExistsAtPath:path]) {
33 |
34 | return [fileManager createFileAtPath:path contents:nil attributes:nil];
35 | }
36 | return TRUE;
37 | }
38 |
39 | + (BOOL)fileExist:(NSString *)path {
40 | NSFileManager *fileManager = [NSFileManager defaultManager];
41 | return ([fileManager fileExistsAtPath:path]);
42 | }
43 |
44 | + (BOOL)directoryExist:(NSString *)path {
45 | BOOL isDirectory = NO;
46 | NSFileManager *fileManager = [NSFileManager defaultManager];
47 | BOOL exist = ([fileManager fileExistsAtPath:path isDirectory:&isDirectory]);
48 | return (exist && isDirectory);
49 | }
50 |
51 | + (BOOL)moveFileAtPath:(NSString *)atPath toPath:(NSString *)toPath{
52 |
53 | NSFileManager *fileManager = [NSFileManager defaultManager];
54 | if (atPath.length > 0 && toPath.length > 0) {/** 如果文件路径为空就不操作 */
55 | NSError *error = nil;
56 | BOOL isOK = [fileManager moveItemAtPath:atPath toPath:toPath error:&error];
57 | if (error) {
58 | NSLog(@"moveFileAtPath error:%@", error.localizedDescription);
59 | }
60 | return isOK;
61 | } else {
62 | return NO;
63 | }
64 | }
65 |
66 | + (BOOL)copyFileAtPath:(NSString *)atPath toPath:(NSString *)toPath{
67 |
68 | NSFileManager *fileManager = [NSFileManager defaultManager];
69 | if (atPath.length > 0 && toPath.length > 0) {/** 如果文件路径为空就不复制 */
70 | return ([fileManager copyItemAtPath:atPath toPath:toPath error:nil]);
71 | }else{
72 | return NO;
73 | }
74 | }
75 |
76 | + (BOOL)removeFile:(NSString *)path {
77 |
78 | NSFileManager *fileManager = [NSFileManager defaultManager];
79 | if ([fileManager fileExistsAtPath:path]) {
80 | return ([fileManager removeItemAtPath:path error:nil]);
81 | } else {
82 | return NO;
83 | }
84 | }
85 |
86 | + (void)writeLogToFile:(NSString *)filePath appendTxt:(NSString *)txt {
87 |
88 | @synchronized(self) {
89 | NSDate *today = [NSDate date];
90 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
91 | [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
92 | NSString *content = [NSString stringWithFormat:@"%@ _%@\n", [formatter stringFromDate:today], txt];
93 | NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
94 |
95 | NSFileManager *filemgr = [NSFileManager defaultManager];
96 | if ([filemgr fileExistsAtPath: filePath ] == FALSE)
97 | {
98 | NSLog (@"File not found");
99 | [filemgr createFileAtPath:filePath contents:contentData attributes:nil];
100 |
101 | }else {
102 |
103 | NSFileHandle *myHandle = [NSFileHandle fileHandleForWritingAtPath:filePath];
104 | if (myHandle == nil) {
105 | NSLog(@"Failed to open file");
106 | return;
107 | }
108 | [myHandle seekToEndOfFile];
109 | [myHandle writeData:contentData];
110 | [myHandle closeFile];
111 | }
112 | }
113 | }
114 |
115 | + (u_int64_t)fileSizeForPath:(NSString *)path
116 | {
117 | signed long long fileSize = 0;
118 | NSFileManager *fileManager = [NSFileManager new]; // default is not thread safe
119 | if ([fileManager fileExistsAtPath:path]) {
120 | NSError *error = nil;
121 | NSDictionary *fileDict = [fileManager attributesOfItemAtPath:path error:&error];
122 | if (!error && fileDict) {
123 | fileSize = [fileDict fileSize];
124 | }
125 | }
126 | return fileSize;
127 | }
128 |
129 | + (NSArray *)findFile:(NSString *)path
130 | {
131 | NSFileManager *fileManager = [NSFileManager defaultManager];
132 | NSArray *array = [fileManager contentsOfDirectoryAtPath:path error:nil];
133 | return array;
134 | }
135 |
136 | /**
137 | * 根据文件大小返回文件大小字符串
138 | *
139 | * @param aSize 文件大小,单位B
140 | *
141 | * @return 文件大小字符串
142 | */
143 | + (NSString *)getFileSizeString:(float)aSize{
144 | NSArray *unitText = @[@"B",@"K",@"M",@"G",@"T"];
145 | NSInteger index = 0;
146 | while (aSize > 999) {
147 | index++;
148 | aSize /= 1024;
149 | }
150 | NSNumberFormatter *nFormat = [[NSNumberFormatter alloc] init];
151 | [nFormat setNumberStyle:NSNumberFormatterDecimalStyle];
152 | [nFormat setMaximumFractionDigits:1];
153 | return [NSString stringWithFormat:@"%@%@",[nFormat stringFromNumber:[NSNumber numberWithFloat:aSize]],[unitText objectAtIndex:index]];
154 | }
155 |
156 | @end
157 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/GIFUtils/LFGIFImageSerialization.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFGIFImageSerialization.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/5/17.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | extern __attribute__((overloadable)) NSData * _Nullable LF_UIImageGIFRepresentation(UIImage * _Nonnull image);
12 |
13 | extern __attribute__((overloadable)) NSData * _Nullable LF_UIImageGIFRepresentation(UIImage * _Nonnull image, NSTimeInterval duration, NSUInteger loopCount, NSError * _Nullable __autoreleasing * _Nullable error);
14 |
15 | extern __attribute__((overloadable)) NSData * _Nullable LF_UIImagePNGRepresentation(UIImage * _Nonnull image, CGFloat compressionQuality);
16 |
17 | extern __attribute__((overloadable)) NSData * _Nullable LF_UIImageJPEGRepresentation(UIImage * _Nonnull image, CGFloat compressionQuality);
18 |
19 | extern __attribute__((overloadable)) NSData * _Nullable LF_UIImageRepresentation(UIImage * _Nonnull image, CGFloat compressionQuality, CFStringRef __nonnull type, NSError * _Nullable __autoreleasing * _Nullable error);
20 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/GIFUtils/LFGIFImageSerialization.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFGIFImageSerialization.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/5/17.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFGIFImageSerialization.h"
10 | #import
11 | #import
12 |
13 | NSString * const LF_AnimatedGIFImageErrorDomain = @"com.compuserve.gif.image.error";
14 |
15 | __attribute__((overloadable)) NSData * LF_UIImageGIFRepresentation(UIImage *image) {
16 | return LF_UIImageGIFRepresentation(image, 0.0f, 0, nil);
17 | }
18 |
19 | __attribute__((overloadable)) NSData * LF_UIImageGIFRepresentation(UIImage *image, NSTimeInterval duration, NSUInteger loopCount, NSError * __autoreleasing *error) {
20 | if (!image.images) {
21 | return nil;
22 | }
23 |
24 | NSDictionary *userInfo = nil;
25 | {
26 | size_t frameCount = image.images.count;
27 | NSTimeInterval frameDuration = (duration <= 0.0 ? image.duration / frameCount : duration / frameCount);
28 | NSDictionary *frameProperties = @{
29 | (__bridge NSString *)kCGImagePropertyGIFDictionary: @{
30 | (__bridge NSString *)kCGImagePropertyGIFDelayTime: @(frameDuration)
31 | }
32 | };
33 |
34 | NSMutableData *mutableData = [NSMutableData data];
35 | CGImageDestinationRef destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)mutableData, kUTTypeGIF, frameCount, NULL);
36 |
37 | NSDictionary *imageProperties = @{ (__bridge NSString *)kCGImagePropertyGIFDictionary: @{
38 | (__bridge NSString *)kCGImagePropertyGIFLoopCount: @(loopCount)
39 | }
40 | };
41 | CGImageDestinationSetProperties(destination, (__bridge CFDictionaryRef)imageProperties);
42 |
43 | for (size_t idx = 0; idx < image.images.count; idx++) {
44 | CGImageDestinationAddImage(destination, [[image.images objectAtIndex:idx] CGImage], (__bridge CFDictionaryRef)frameProperties);
45 | }
46 |
47 | BOOL success = CGImageDestinationFinalize(destination);
48 | CFRelease(destination);
49 |
50 | if (!success) {
51 | userInfo = @{
52 | NSLocalizedDescriptionKey: NSLocalizedString(@"Could not finalize image destination", nil)
53 | };
54 |
55 | goto _error;
56 | }
57 |
58 | return [NSData dataWithData:mutableData];
59 | }
60 | _error: {
61 | if (error) {
62 | *error = [[NSError alloc] initWithDomain:LF_AnimatedGIFImageErrorDomain code:-1 userInfo:userInfo];
63 | }
64 |
65 | return nil;
66 | }
67 | }
68 |
69 | __attribute__((overloadable)) NSData * LF_UIImagePNGRepresentation(UIImage *image, CGFloat compressionQuality) {
70 | return LF_UIImageRepresentation(image, compressionQuality, kUTTypePNG, nil);
71 | }
72 |
73 | __attribute__((overloadable)) NSData * LF_UIImageJPEGRepresentation(UIImage *image, CGFloat compressionQuality) {
74 | return LF_UIImageRepresentation(image, compressionQuality, kUTTypeJPEG, nil);
75 | }
76 |
77 | __attribute__((overloadable)) NSData * LF_UIImageRepresentation(UIImage *image, CGFloat compressionQuality, CFStringRef __nonnull type, NSError * __autoreleasing *error) {
78 |
79 | if (!image) {
80 | return nil;
81 | }
82 | NSDictionary *userInfo = nil;
83 | {
84 | NSDictionary *frameProperties = nil;
85 |
86 | frameProperties = @{
87 | (__bridge NSString *)kCGImageDestinationLossyCompressionQuality: @(MIN(MAX(compressionQuality, 0), 1))
88 | };
89 |
90 | NSMutableData *mutableData = [NSMutableData data];
91 |
92 | CGImageDestinationRef destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)mutableData, type, 1, NULL);
93 |
94 | if (frameProperties) {
95 | CGImageDestinationAddImage(destination, [image CGImage], (__bridge CFDictionaryRef)frameProperties);
96 | } else {
97 | CGImageDestinationAddImage(destination, [image CGImage], NULL);
98 | }
99 |
100 | BOOL success = CGImageDestinationFinalize(destination);
101 | CFRelease(destination);
102 |
103 | if (!success) {
104 | userInfo = @{
105 | NSLocalizedDescriptionKey: NSLocalizedString(@"Could not finalize image destination", nil)
106 | };
107 |
108 | goto _error;
109 | }
110 |
111 | return [NSData dataWithData:mutableData];
112 | }
113 | _error: {
114 | if (error) {
115 | *error = [[NSError alloc] initWithDomain:LF_AnimatedGIFImageErrorDomain code:-1 userInfo:userInfo];
116 | }
117 |
118 | return nil;
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/utils/VideoUtils/LF_VideoUtils.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoUtils.h
3 | // MEMobile
4 | //
5 | // Created by LamTsanFeng on 15/11/11.
6 | // Copyright © 2015年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 |
13 | @interface LF_VideoUtils : NSObject
14 |
15 | /** 将视频轨迹AVAssetTrack转换为UIImageOrientation */
16 | + (UIImageOrientation)orientationFromAVAssetTrack:(AVAssetTrack *)videoTrack;
17 |
18 | /** 视频压缩URL */
19 | + (void)encodeVideoWithURL:(NSURL *)videoURL outPath:(NSString *)outPath complete:(void (^)(BOOL isSuccess, NSError *error))complete;
20 | + (void)encodeVideoWithURL:(NSURL *)videoURL outPath:(NSString *)outPath presetName:(NSString *)presetName complete:(void (^)(BOOL isSuccess, NSError *error))complete;
21 |
22 | /** 视频压缩Asset */
23 | + (void)encodeVideoWithAsset:(AVAsset *)asset outPath:(NSString *)outPath complete:(void (^)(BOOL isSuccess, NSError *error))complete;
24 | + (void)encodeVideoWithAsset:(AVAsset *)asset outPath:(NSString *)outPath presetName:(NSString *)presetName complete:(void (^)(BOOL isSuccess, NSError *error))complete;
25 |
26 | /*
27 | * 获取第N帧的图片
28 | *videoURL:视频地址(本地/网络)
29 | *time :第N帧
30 | */
31 | + (UIImage *)thumbnailImageForVideo:(NSURL *)videoURL atTime:(NSTimeInterval)time;
32 |
33 | /**
34 | * @author lincf, 16-06-08 10:06:01
35 | *
36 | * 获取视频大小
37 | *
38 | * @param path 视频路径
39 | *
40 | * @return 视频大小CGSize
41 | */
42 | + (CGSize)videoNaturalSizeWithPath:(NSString *)path;
43 |
44 |
45 | /**
46 | * @author lincf, 16-06-13 15:06:59
47 | *
48 | * 获取视频时长
49 | *
50 | * @param path 视频路径
51 | *
52 | * @return 视频时长long long
53 | */
54 | + (long long)videoSectionTimeWithPath:(NSString *)path;
55 |
56 | /**
57 | * @author lincf
58 | *
59 | * 视频能否播放
60 | *
61 | * @param path 视频路径
62 | *
63 | */
64 | + (BOOL)videoCanPlayWithPath:(NSString *)path;
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/view/ablumTitleView/LFAlbumTitleView.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFAlbumTitleView.h
3 | // LFImagePickerController
4 | //
5 | // Created by TsanFeng Lam on 2019/9/24.
6 | // Copyright © 2019 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LFAlbum.h"
11 | #import "LFImagePickerPublicHeader.h"
12 |
13 | NS_ASSUME_NONNULL_BEGIN
14 |
15 | typedef NS_ENUM(NSUInteger, LFAlbumTitleViewState) {
16 | LFAlbumTitleViewStateInactive,
17 | LFAlbumTitleViewStateActivity,
18 | };
19 |
20 | @interface LFAlbumTitleView : UIView
21 |
22 | - (instancetype)initWithContentViewController:(UIViewController *)contentViewController;
23 | - (instancetype)initWithContentViewController:(UIViewController *)contentViewController index:(NSInteger)index;
24 |
25 | @property (nonatomic, strong) NSArray *albumArr;
26 | @property (nonatomic, readonly) LFAlbum *selectedAlbum;
27 |
28 | /** 自定义title */
29 | @property (nonatomic, copy) NSString *title;
30 | /** 选中图标 */
31 | @property (nonatomic, copy) NSString *selectImageName;
32 |
33 | /** 文字字体 boldSystemFontOfSize 18 */
34 | @property(nonatomic, strong) UIFont *titleFont;
35 | /** 文字颜色 灰色 */
36 | @property(nonatomic, strong) UIColor *titleColor;
37 | /** 当前序列 default -1 */
38 | @property(nonatomic, assign, readonly) NSInteger index;
39 | /** 点击背景隐藏 default YES */
40 | @property(nonatomic, assign, getter=isTapBackgroundHidden) BOOL tapBackgroundHidden;
41 | /** 状态 */
42 | @property (nonatomic, assign) LFAlbumTitleViewState state;
43 | /** 点击回调 */
44 | @property (nonatomic, copy) void(^didSelected)(LFAlbum *album, NSInteger index);
45 |
46 | @end
47 |
48 | NS_ASSUME_NONNULL_END
49 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/view/previewBar/LFPreviewBar.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPreviewBar.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/5/24.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class LFAsset;
12 |
13 | @interface LFPreviewBar : UIView
14 |
15 | @property (nonatomic, strong) NSArray *dataSource;
16 | /** 选择数据源 */
17 | @property (nonatomic, strong) NSMutableArray *selectedDataSource;
18 |
19 | /** 显示与刷新游标 */
20 | @property (nonatomic, strong) LFAsset *selectAsset;
21 |
22 | /** 选择框大小 2.f */
23 | @property (nonatomic, assign) CGFloat borderWidth;
24 | /** 选择框颜色 blackColor */
25 | @property (nonatomic, strong) UIColor *borderColor;
26 |
27 | /** 添加数据源 */
28 | - (void)addAssetInDataSource:(LFAsset *)asset;
29 | /** 删除数据源 */
30 | - (void)removeAssetInDataSource:(LFAsset *)asset;
31 |
32 | @property (nonatomic, copy) void(^didSelectItem)(LFAsset *asset);
33 | @property (nonatomic, copy) void(^didMoveItem)(LFAsset *asset, NSInteger sourceIndex, NSInteger destinationIndex);
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/view/previewBar/subView/LFPreviewBarCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFPreviewBarCell.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/5/24.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class LFAsset;
12 | @interface LFPreviewBarCell : UICollectionViewCell
13 |
14 | + (NSString *)identifier;
15 |
16 | @property (nonatomic, strong) LFAsset *asset;
17 | @property (nonatomic, assign) BOOL isSelectedAsset;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/class/view/previewBar/subView/LFPreviewBarCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // LFPreviewBarCell.m
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/5/24.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import "LFPreviewBarCell.h"
10 | #import "LFImagePickerHeader.h"
11 |
12 | #import "LFAssetManager.h"
13 | #ifdef LF_MEDIAEDIT
14 | #import "LFPhotoEditManager.h"
15 | #import "LFPhotoEdit.h"
16 | #import "LFVideoEditManager.h"
17 | #import "LFVideoEdit.h"
18 | #endif
19 |
20 | @interface LFPreviewBarCell ()
21 |
22 | /** 展示图片 */
23 | @property (nonatomic, weak) UIImageView *imageView;
24 | /** 编辑标记 */
25 | @property (weak, nonatomic) UIImageView *editMaskImageView;
26 | /** 视频标记 */
27 | @property (weak, nonatomic) UIImageView *videoMaskImageView;
28 | /** 遮罩 */
29 | @property (nonatomic, weak) UIView *maskHitView;
30 |
31 | @end
32 |
33 | @implementation LFPreviewBarCell
34 |
35 | + (NSString *)identifier
36 | {
37 | return NSStringFromClass([self class]);
38 | }
39 |
40 | - (instancetype)initWithFrame:(CGRect)frame
41 | {
42 | self = [super initWithFrame:frame];
43 | if (self) {
44 | [self customInit];
45 | }
46 | return self;
47 | }
48 |
49 | - (instancetype)initWithCoder:(NSCoder *)coder
50 | {
51 | self = [super initWithCoder:coder];
52 | if (self) {
53 | [self customInit];
54 | }
55 | return self;
56 | }
57 |
58 | - (void)prepareForReuse
59 | {
60 | [super prepareForReuse];
61 | self.imageView.image = nil;
62 | }
63 |
64 | - (void)customInit
65 | {
66 | self.backgroundColor = [UIColor clearColor];
67 | UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.bounds];
68 | imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
69 | imageView.contentMode = UIViewContentModeScaleAspectFill;
70 | imageView.clipsToBounds = YES;
71 | [self.contentView addSubview:imageView];
72 | self.imageView = imageView;
73 |
74 | UIImageView *editMaskImageView = [[UIImageView alloc] init];
75 | CGRect editFrame = CGRectMake(5, 5, 13.5, 11);
76 | editMaskImageView.frame = editFrame;
77 | [editMaskImageView setImage:bundleImageNamed(@"contacts_add_myablum")];
78 | editMaskImageView.contentMode = UIViewContentModeScaleAspectFit;
79 | [self.contentView addSubview:editMaskImageView];
80 | _editMaskImageView = editMaskImageView;
81 |
82 | UIImageView *videoMaskImageView = [[UIImageView alloc] init];
83 | CGRect videoFrame = CGRectMake(5, self.frame.size.height - 11 - 5, 18, 11);
84 | videoMaskImageView.frame = videoFrame;
85 | [videoMaskImageView setImage:bundleImageNamed(@"fileicon_video_wall")];
86 | videoMaskImageView.contentMode = UIViewContentModeScaleAspectFit;
87 | videoMaskImageView.hidden = YES;
88 | [self.contentView addSubview:videoMaskImageView];
89 | _videoMaskImageView = videoMaskImageView;
90 |
91 |
92 | UIView *maskHitView = [[UIView alloc] initWithFrame:self.bounds];
93 | maskHitView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
94 | maskHitView.backgroundColor = [UIColor colorWithWhite:1.f alpha:0.5f];
95 | maskHitView.hidden = YES;
96 | [self.contentView addSubview:maskHitView];
97 | self.maskHitView = maskHitView;
98 | }
99 |
100 | - (void)setAsset:(LFAsset *)asset
101 | {
102 | _asset = asset;
103 |
104 | BOOL hiddenEditMask = YES;
105 | if (self.asset.type == LFAssetMediaTypePhoto) {
106 | #ifdef LF_MEDIAEDIT
107 | /** 优先显示编辑图片 */
108 | LFPhotoEdit *photoEdit = [[LFPhotoEditManager manager] photoEditForAsset:asset];
109 | if (photoEdit.editPosterImage) {
110 | self.imageView.image = photoEdit.editPosterImage;
111 | hiddenEditMask = NO;
112 | } else {
113 | #endif
114 | [self getAssetImage:asset];
115 | #ifdef LF_MEDIAEDIT
116 | }
117 | #endif
118 | /** 显示编辑标记 */
119 | self.editMaskImageView.hidden = hiddenEditMask;
120 | } else if (self.asset.type == LFAssetMediaTypeVideo) {
121 | #ifdef LF_MEDIAEDIT
122 | /** 优先显示编辑图片 */
123 | LFVideoEdit *videoEdit = [[LFVideoEditManager manager] videoEditForAsset:asset];
124 | if (videoEdit.editPosterImage) {
125 | self.imageView.image = videoEdit.editPosterImage;
126 | hiddenEditMask = NO;
127 | } else {
128 | #endif
129 | [self getAssetImage:asset];
130 | #ifdef LF_MEDIAEDIT
131 | }
132 | #endif
133 | /** 显示编辑标记 */
134 | self.editMaskImageView.hidden = hiddenEditMask;
135 | }
136 | /** 显示视频标记 */
137 | if (_asset.type == LFAssetMediaTypeVideo) {
138 | self.videoMaskImageView.hidden = NO;
139 | } else {
140 | self.videoMaskImageView.hidden = YES;
141 | }
142 | }
143 |
144 | - (void)setIsSelectedAsset:(BOOL)isSelectedAsset
145 | {
146 | _isSelectedAsset = isSelectedAsset;
147 | /** 显示遮罩 */
148 | self.maskHitView.hidden = isSelectedAsset;
149 | }
150 |
151 |
152 | - (void)getAssetImage:(LFAsset *)asset
153 | {
154 | if (asset.thumbnailImage) { /** 显示自定义图片 */
155 | self.imageView.image = (asset.previewImage.images.count > 0 ? asset.previewImage.images.firstObject : asset.thumbnailImage);
156 | } else {
157 | [[LFAssetManager manager] getPhotoWithAsset:asset.asset photoWidth:self.frame.size.width completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
158 | if ([asset.asset isEqual:self.asset.asset]) {
159 | self.imageView.image = photo;
160 | } else {
161 | self.imageView.image = nil;
162 | }
163 |
164 | } progressHandler:nil networkAccessAllowed:NO];
165 | }
166 | }
167 | @end
168 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/vendors/LFGifPlayer/LFGifPlayerManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // GifUtils.h
3 | // MEMobile
4 | //
5 | // Created by LamTsanFeng on 16/9/14.
6 | // Copyright © 2016年 GZMiracle. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 |
13 | typedef void (^GifExecution) (CGImageRef imageData, NSString *key);
14 | typedef void (^GifFail) (NSString *key);
15 |
16 | @interface LFGifPlayerManager : NSObject
17 |
18 | + (LFGifPlayerManager *)shared;
19 | /** 释放 */
20 | + (void)free;
21 |
22 | /** 停止播放 */
23 | - (void)stopGIFWithKey:(NSString *)key;
24 | /** 暂停播放 */
25 | - (void)suspendGIFWithKey:(NSString *)key;
26 | /** 恢复播放 */
27 | - (void)resumeGIFWithKey:(NSString *)key execution:(GifExecution)executionBlock fail:(GifFail)failBlock;
28 | /** 是否播放 */
29 | - (BOOL)isGIFPlaying:(NSString *)key;
30 | /** 是否存在 */
31 | - (BOOL)containGIFKey:(NSString *)key;
32 |
33 | /**
34 | * @author lincf, 16-09-14 14:09:21
35 | *
36 | * 播放gif
37 | *
38 | * @param gifPath 文件路径
39 | * @param key gif标记
40 | * @param executionBlock 成功回调 循环回调 gif的每一帧
41 | * @param failBlock 失败回调 一次
42 | */
43 | - (void)transformGifPathToSampBufferRef:(NSString *)gifPath key:(NSString *)key execution:(GifExecution)executionBlock fail:(GifFail)failBlock;
44 |
45 | /**
46 | * @author lincf, 16-09-14 14:09:41
47 | *
48 | * 播放gif
49 | *
50 | * @param gifData 文件数据
51 | * @param key gif标记
52 | * @param executionBlock 成功回调 循环回调 gif的每一帧
53 | * @param failBlock 失败回调 一次
54 | */
55 | - (void)transformGifDataToSampBufferRef:(NSData *)gifData key:(NSString *)key execution:(GifExecution)executionBlock fail:(GifFail)failBlock;
56 | @end
57 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/vendors/LFGifPlayer/LFWeakProxy.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYWeakProxy.h
3 | // YYKit
4 | //
5 | // Created by ibireme on 14/10/18.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | A proxy used to hold a weak object.
18 | It can be used to avoid retain cycles, such as the target in NSTimer or CADisplayLink.
19 |
20 | sample code:
21 |
22 | @implementation MyView {
23 | NSTimer *_timer;
24 | }
25 |
26 | - (void)initTimer {
27 | YYWeakProxy *proxy = [YYWeakProxy proxyWithTarget:self];
28 | _timer = [NSTimer timerWithTimeInterval:0.1 target:proxy selector:@selector(tick:) userInfo:nil repeats:YES];
29 | }
30 |
31 | - (void)tick:(NSTimer *)timer {...}
32 | @end
33 | */
34 | @interface LFWeakProxy : NSProxy
35 |
36 | /**
37 | The proxy target.
38 | */
39 | @property (nullable, nonatomic, weak, readonly) id target;
40 |
41 | /**
42 | Creates a new weak proxy for target.
43 |
44 | @param target Target object.
45 |
46 | @return A new proxy object.
47 | */
48 | - (instancetype)initWithTarget:(id)target;
49 |
50 | /**
51 | Creates a new weak proxy for target.
52 |
53 | @param target Target object.
54 |
55 | @return A new proxy object.
56 | */
57 | + (instancetype)proxyWithTarget:(id)target;
58 |
59 | @end
60 |
61 | NS_ASSUME_NONNULL_END
62 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/vendors/LFGifPlayer/LFWeakProxy.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYWeakProxy.m
3 | // YYKit
4 | //
5 | // Created by ibireme on 14/10/18.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "LFWeakProxy.h"
13 |
14 |
15 | @implementation LFWeakProxy
16 |
17 | - (instancetype)initWithTarget:(id)target {
18 | _target = target;
19 | return self;
20 | }
21 |
22 | + (instancetype)proxyWithTarget:(id)target {
23 | return [[LFWeakProxy alloc] initWithTarget:target];
24 | }
25 |
26 | - (id)forwardingTargetForSelector:(SEL)selector {
27 | return _target;
28 | }
29 |
30 | - (void)forwardInvocation:(NSInvocation *)invocation {
31 | void *null = NULL;
32 | [invocation setReturnValue:&null];
33 | }
34 |
35 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector {
36 | return [NSObject instanceMethodSignatureForSelector:@selector(init)];
37 | }
38 |
39 | - (BOOL)respondsToSelector:(SEL)aSelector {
40 | return [_target respondsToSelector:aSelector];
41 | }
42 |
43 | - (BOOL)isEqual:(id)object {
44 | return [_target isEqual:object];
45 | }
46 |
47 | - (NSUInteger)hash {
48 | return [_target hash];
49 | }
50 |
51 | - (Class)superclass {
52 | return [_target superclass];
53 | }
54 |
55 | - (Class)class {
56 | return [_target class];
57 | }
58 |
59 | - (BOOL)isKindOfClass:(Class)aClass {
60 | return [_target isKindOfClass:aClass];
61 | }
62 |
63 | - (BOOL)isMemberOfClass:(Class)aClass {
64 | return [_target isMemberOfClass:aClass];
65 | }
66 |
67 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol {
68 | return [_target conformsToProtocol:aProtocol];
69 | }
70 |
71 | - (BOOL)isProxy {
72 | return YES;
73 | }
74 |
75 | - (NSString *)description {
76 | return [_target description];
77 | }
78 |
79 | - (NSString *)debugDescription {
80 | return [_target debugDescription];
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LFImagePickerController/LFImagePickerController/vendors/LFToGIF/LFToGIF.h:
--------------------------------------------------------------------------------
1 | //
2 | // LFToGIF.h
3 | // LFImagePickerController
4 | //
5 | // Created by LamTsanFeng on 2017/6/2.
6 | // Copyright © 2017年 LamTsanFeng. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 | #import
13 |
14 | #if TARGET_OS_IPHONE
15 | #import
16 | #import
17 | #elif TARGET_OS_MAC
18 | #import
19 | #import
20 | #endif
21 |
22 | typedef NS_ENUM(NSInteger, LF_GIFSize) {
23 | LF_GIFSizeVeryLow = 2,
24 | LF_GIFSizeLow = 3,
25 | LF_GIFSizeMedium = 5,
26 | LF_GIFSizeHigh = 7,
27 | LF_GIFSizeOriginal = 10
28 | };
29 |
30 | @interface LFToGIF : NSObject
31 |
32 |
33 | /**
34 | 解析视频转换为GIF图片
35 |
36 | @param videoURL 视频地址
37 | @param loopCount 循环次数 0=无限循环
38 | @param completionBlock 回调gif地址
39 | */
40 | + (void)optimalGIFfromURL:(NSURL*)videoURL loopCount:(int)loopCount completion:(void(^)(NSURL *GifURL))completionBlock;
41 |
42 | /**
43 | 解析视频转换为GIF图片
44 |
45 | @param videoURL 视频地址
46 | @param delayTime 每张图片的停留时间
47 | @param loopCount 循环次数 0=无限循环
48 | @param LF_GIFSize gif图片质量
49 | @param completionBlock 回调gif地址
50 | */
51 | + (void)createGIFfromURL:(NSURL*)videoURL delayTime:(NSTimeInterval)delayTime loopCount:(NSUInteger)loopCount LF_GIFSize:(LF_GIFSize)LF_GIFSize completion:(void(^)(NSURL *GifURL))completionBlock;
52 | @end
53 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 lincf0912
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Pods/LFImagePickerController/README.md:
--------------------------------------------------------------------------------
1 | # LFImagePickerController
2 |
3 | [English](https://github.com/lincf0912/LFImagePickerController/blob/master/README_EN.md)
4 |
5 | * 它起始于TZImagePickerController项目,感谢分享。
6 | * 兼容自定义图片/视频的展示方式
7 | * 支持Gif(可压缩)、视频(可压缩)、图片(可压缩)
8 | * 图片编辑、视频编辑(依赖LFMediaEditingController库,默认没有编辑功能)
9 | * 视频编辑 需要访问音乐库 需要在info.plist 添加 NSAppleMusicUsageDescription
10 | * 支持iPhone、iPad 横屏
11 | * 支持国际化配置(复制LFImagePickerController.bundle\LFImagePickerController.strings到项目中,修改对应的值即可;详情见DEMO;注意:不跟随系统语言切换显示)
12 | * 详细使用见LFImagePickerController.h 的初始化方法
13 |
14 | ## Installation 安装
15 |
16 | * CocoaPods:pod 'LFImagePickerController' 或 pod 'LFImagePickerController/LFMediaEdit' (带编辑功能)
17 |
18 | ## Demo配置编辑功能(不用编辑功能可以忽略)
19 |
20 | * 使用pod install安装LFMediaEditingController库
21 | * 在LFImagePickerController的project --> Build Settings --> Preprocessor Macros --> 在Debug与Release添加LF_MEDIAEDIT=1
22 |
23 | ## 调用代码
24 |
25 | * LFImagePickerController *imagePicker = [[LFImagePickerController alloc] initWithMaxImagesCount:9 delegate:self];
26 | * //根据需求设置
27 | * imagePicker.allowTakePicture = NO; //不显示拍照按钮
28 | * imagePicker.doneBtnTitleStr = @"发送"; //最终确定按钮名称
29 | * [self presentViewController:imagePicker animated:YES completion:nil];
30 |
31 | ## 个性化
32 | * maxVideosCount ==> 视频最大可选数量,默认和maxImagesCount值一致。如果`maxImagesCount != maxImagesCount`,会由原来的混合选择转变为单一选择(要么选图片、要么选视频)。
33 | * defaultAlbumName ==> 可以改变默认显示的相册;例如:`defaultAlbumName = @"动图";`
34 | * thumbnailCompressSize ==> 如果不需要返回值LFResultImage的thumbnailImage和thumbnailData,可以`thumbnailCompressSize = 0;`回调的响应效率更快。
35 | * autoSavePhotoAlbum ==> 默认将编辑后的图片或视频保存到相册内
36 | * syncAlbum ==> 与系统相册同步。如果`syncAlbum = YES;`可能会导致正在编辑的数据丢失(可能你正在编辑的图片被删除了)。
37 | * selectedAssets ==> 默认已选中的数据。
38 | * 请预览LFImagePickerController.h了解更多功能。
39 |
40 |
41 | ## 图片展示
42 |
43 | 
44 |
45 | ## 适配iOS13的UIModalPresentationPageSheet
46 |
47 | 
48 |
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - LFAssetExportSession (1.0.2)
3 | - LFImagePickerController (1.7.3.2):
4 | - LFImagePickerController/Core (= 1.7.3.2)
5 | - LFImagePickerController/Core (1.7.3.2):
6 | - LFAssetExportSession
7 | - LFImagePickerController/LFGifPlayer
8 | - LFImagePickerController/LFToGIF
9 | - LFImagePickerController/LFGifPlayer (1.7.3.2)
10 | - LFImagePickerController/LFToGIF (1.7.3.2)
11 |
12 | DEPENDENCIES:
13 | - LFImagePickerController
14 |
15 | SPEC REPOS:
16 | trunk:
17 | - LFAssetExportSession
18 | - LFImagePickerController
19 |
20 | SPEC CHECKSUMS:
21 | LFAssetExportSession: bd22818d071a842fd594a72f188321a91ba13f0d
22 | LFImagePickerController: 8555536985af7b80167476cf267824f69102da62
23 |
24 | PODFILE CHECKSUM: f6fb2f87c1fdaa6e3acd757765998cbb92c047bb
25 |
26 | COCOAPODS: 1.9.3
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFAssetExportSession/LFAssetExportSession-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.2
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFAssetExportSession/LFAssetExportSession-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_LFAssetExportSession : NSObject
3 | @end
4 | @implementation PodsDummy_LFAssetExportSession
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFAssetExportSession/LFAssetExportSession-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFAssetExportSession/LFAssetExportSession-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "LFAssetExportSession.h"
14 |
15 | FOUNDATION_EXPORT double LFAssetExportSessionVersionNumber;
16 | FOUNDATION_EXPORT const unsigned char LFAssetExportSessionVersionString[];
17 |
18 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFAssetExportSession/LFAssetExportSession.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | PODS_BUILD_DIR = ${BUILD_DIR}
4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
5 | PODS_ROOT = ${SRCROOT}
6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/LFAssetExportSession
7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
8 | SKIP_INSTALL = YES
9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
10 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFAssetExportSession/LFAssetExportSession.modulemap:
--------------------------------------------------------------------------------
1 | framework module LFAssetExportSession {
2 | umbrella header "LFAssetExportSession-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFAssetExportSession/LFAssetExportSession.release.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | PODS_BUILD_DIR = ${BUILD_DIR}
4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
5 | PODS_ROOT = ${SRCROOT}
6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/LFAssetExportSession
7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
8 | SKIP_INSTALL = YES
9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
10 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFImagePickerController/LFImagePickerController-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.7.3
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFImagePickerController/LFImagePickerController-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_LFImagePickerController : NSObject
3 | @end
4 | @implementation PodsDummy_LFImagePickerController
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFImagePickerController/LFImagePickerController-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFImagePickerController/LFImagePickerController-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "LFImagePickerController.h"
14 | #import "LFLayoutPickerController.h"
15 | #import "LFAssetManager+Authorization.h"
16 | #import "LFAssetManager+CreateMedia.h"
17 | #import "LFAssetManager+SaveAlbum.h"
18 | #import "LFAssetManager+Simple.h"
19 | #import "LFAssetManager.h"
20 | #import "LFPhotoEditManager.h"
21 | #import "LFVideoEditManager.h"
22 | #import "LFAlbum+SmartAlbum.h"
23 | #import "LFAlbum.h"
24 | #import "LFAsset+property.h"
25 | #import "LFAsset.h"
26 | #import "LFAssetImageProtocol.h"
27 | #import "LFAssetPhotoProtocol.h"
28 | #import "LFAssetVideoProtocol.h"
29 | #import "LFResultImage.h"
30 | #import "LFResultInfo.h"
31 | #import "LFResultObject.h"
32 | #import "LFResultVideo.h"
33 | #import "LFImagePickerPublicHeader.h"
34 | #import "LFGifPlayerManager.h"
35 | #import "LFToGIF.h"
36 |
37 | FOUNDATION_EXPORT double LFImagePickerControllerVersionNumber;
38 | FOUNDATION_EXPORT const unsigned char LFImagePickerControllerVersionString[];
39 |
40 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFImagePickerController/LFImagePickerController.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/LFImagePickerController
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFImagePickerController/LFImagePickerController.modulemap:
--------------------------------------------------------------------------------
1 | framework module LFImagePickerController {
2 | umbrella header "LFImagePickerController-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFImagePickerController/LFImagePickerController.release.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/LFImagePickerController
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/LFImagePickerController/LFImagePickerController.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/LFImagePickerController" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LFImagePickerController"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/LFImagePickerController
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ImagePickerSheet/Pods-ImagePickerSheet-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ImagePickerSheet/Pods-ImagePickerSheet-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## LFAssetExportSession
5 |
6 | MIT License
7 |
8 | Copyright (c) 2020 Lam
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 |
28 |
29 | ## LFImagePickerController
30 |
31 | MIT License
32 |
33 | Copyright (c) 2017 lincf0912
34 |
35 | Permission is hereby granted, free of charge, to any person obtaining a copy
36 | of this software and associated documentation files (the "Software"), to deal
37 | in the Software without restriction, including without limitation the rights
38 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39 | copies of the Software, and to permit persons to whom the Software is
40 | furnished to do so, subject to the following conditions:
41 |
42 | The above copyright notice and this permission notice shall be included in all
43 | copies or substantial portions of the Software.
44 |
45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51 | SOFTWARE.
52 |
53 | Generated by CocoaPods - https://cocoapods.org
54 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ImagePickerSheet/Pods-ImagePickerSheet-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | MIT License
18 |
19 | Copyright (c) 2020 Lam
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy
22 | of this software and associated documentation files (the "Software"), to deal
23 | in the Software without restriction, including without limitation the rights
24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 | copies of the Software, and to permit persons to whom the Software is
26 | furnished to do so, subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 | SOFTWARE.
38 |
39 | License
40 | MIT
41 | Title
42 | LFAssetExportSession
43 | Type
44 | PSGroupSpecifier
45 |
46 |
47 | FooterText
48 | MIT License
49 |
50 | Copyright (c) 2017 lincf0912
51 |
52 | Permission is hereby granted, free of charge, to any person obtaining a copy
53 | of this software and associated documentation files (the "Software"), to deal
54 | in the Software without restriction, including without limitation the rights
55 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56 | copies of the Software, and to permit persons to whom the Software is
57 | furnished to do so, subject to the following conditions:
58 |
59 | The above copyright notice and this permission notice shall be included in all
60 | copies or substantial portions of the Software.
61 |
62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
68 | SOFTWARE.
69 |
70 | License
71 | MIT
72 | Title
73 | LFImagePickerController
74 | Type
75 | PSGroupSpecifier
76 |
77 |
78 | FooterText
79 | Generated by CocoaPods - https://cocoapods.org
80 | Title
81 |
82 | Type
83 | PSGroupSpecifier
84 |
85 |
86 | StringsTable
87 | Acknowledgements
88 | Title
89 | Acknowledgements
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ImagePickerSheet/Pods-ImagePickerSheet-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_ImagePickerSheet : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_ImagePickerSheet
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ImagePickerSheet/Pods-ImagePickerSheet-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_ImagePickerSheetVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_ImagePickerSheetVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ImagePickerSheet/Pods-ImagePickerSheet.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession" "${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession/LFAssetExportSession.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController/LFImagePickerController.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession/LFAssetExportSession.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController/LFImagePickerController.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController"
6 | OTHER_LDFLAGS = $(inherited) -framework "LFAssetExportSession" -framework "LFImagePickerController"
7 | PODS_BUILD_DIR = ${BUILD_DIR}
8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/..
10 | PODS_ROOT = ${SRCROOT}/../Pods
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ImagePickerSheet/Pods-ImagePickerSheet.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_ImagePickerSheet {
2 | umbrella header "Pods-ImagePickerSheet-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ImagePickerSheet/Pods-ImagePickerSheet.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession" "${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession/LFAssetExportSession.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController/LFImagePickerController.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession/LFAssetExportSession.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController/LFImagePickerController.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/LFAssetExportSession" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/LFImagePickerController"
6 | OTHER_LDFLAGS = $(inherited) -framework "LFAssetExportSession" -framework "LFImagePickerController"
7 | PODS_BUILD_DIR = ${BUILD_DIR}
8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/..
10 | PODS_ROOT = ${SRCROOT}/../Pods
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ImagePickerSheetViewController
2 |
3 | * 模仿IOS8的图片选择器 项目依赖 https://github.com/lincf0912/LFImagePickerController 项目运行
4 |
5 | ## Installation 安装
6 |
7 | * CocoaPods:pod 'ImagePickerSheetViewController'
8 | * 手动导入:将ImagePickerSheet\ImagePickerSheetViewController文件夹拽入项目中,导入头文件:#import "ImagePickerSheetViewController.h",依赖LFImagePickerController
9 | * 开启编辑功能:pod 'LFImagePickerController/LFMediaEdit'
10 |
11 | ## 调用代码
12 |
13 | * ImagePickerSheetViewController *imagePicker = [[ImagePickerSheetViewController alloc] init];
14 | [imagePicker showImagePickerInController:self animated:YES];
15 | * [imagePicker showImagePickerInController:self animated:YES];
16 |
17 | * 设置代理方法,按钮实现
18 | * imagePicker.delegate;
19 |
20 | ## 图片展示
21 |
22 | 
23 |
24 | 
25 |
--------------------------------------------------------------------------------
/screenshots/screenshot.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/screenshots/screenshot.gif
--------------------------------------------------------------------------------
/screenshots/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lincf0912/ImagePickerSheetViewController/9e06bad5d4ab5636797b2bebed43aa408d9b883c/screenshots/screenshot.png
--------------------------------------------------------------------------------