LFImagePicker
is an Image/Video Picker whitch support Image/Video compress in Multiple threads.
LFImagePicker
works on iOS 8.0+ and requires ARC to build. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
- Foundation.framework
- UIKit.framework
- MobileCoreServices.framework
- AVFoundation.framework
- Photos.framework
You will need the latest developer tools in order to build LFImagePicker
. Old Xcode versions might work, but compatibility will not be explicitly maintained.
CocoaPods is the recommended way to add LFImagePicker to your project.
- Add a pod entry for LFImagePicker to your Podfile
pod 'LFImagePicker'
- Install the pod(s) by running
pod install
. - Include LFImagePicker wherever you need it with
#import <LFImagePicker/LFImagePickerViewController.h>
.
You can simply use it as follow.
- (void)didTappedStartButton:(UIButton *)button
{
[self presentViewController:self.picker animated:YES completion:nil];
}
- (LFImagePickerViewController *)picker
{
if (_picker == nil) {
_picker = [[LFImagePickerViewController alloc] init];
_picker.maxSelectedCount = 12;
_picker.delegate = self;
_picker.videoAvailable = YES;
}
return _picker;
}
and play with the Delegate methods
@protocol LFimagePickerDelegate <NSObject>
- (void)imagePicker:(LFImagePickerViewController *)picker didImportImages:(NSArray *)imageList;
- (void)imagePicker:(LFImagePickerViewController *)picker didImportFailedInfo:(NSDictionary *)info;
- (void)imagePicker:(LFImagePickerViewController *)picker didReachMaxSelectedCount:(NSInteger)maxCount;
- (void)imagePicker:(LFImagePickerViewController *)picker didReachMaxVideoCount:(NSInteger)maxCount;
@optional
- (void)imagePicker:(LFImagePickerViewController *)picker didTappedImportButton:(UIButton *)button;
- (void)imagePicker:(LFImagePickerViewController *)picker didRejectSelectVideoAtIndexPath:(NSIndexPath *)indexPath;
- (void)imagePicker:(LFImagePickerViewController *)picker didRejectSelectAudioAtIndexPath:(NSIndexPath *)indexPath;
This code is distributed under the terms and conditions of the MIT license.