Skip to content

cctv1237/LFImagePicker

Repository files navigation

LFImagePicker

CocoaPods compatible License: MIT

LFImagePicker is an Image/Video Picker whitch support Image/Video compress in Multiple threads.

Requirements

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.

Adding LFImagePicker to your project

CocoaPods

CocoaPods is the recommended way to add LFImagePicker to your project.

  1. Add a pod entry for LFImagePicker to your Podfile pod 'LFImagePicker'
  2. Install the pod(s) by running pod install.
  3. Include LFImagePicker wherever you need it with #import <LFImagePicker/LFImagePickerViewController.h>.

Usage

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;

License

This code is distributed under the terms and conditions of the MIT license.

About

A Image/Video Picker which contained data Compress

Resources

License

Stars

Watchers

Forks

Packages

No packages published