Skip to content

简单易用的自定义图片选择器,支持单选,多选,自定义照相。

License

Notifications You must be signed in to change notification settings

ShinyG/GYPhotoPicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GYPhotoPicker

  • 简单易用的自定义图片选择器,支持单选,多选,自定义照相。

#GYPhotoPicker的使用

  • 方法一:通过cocoapods -> pod 'GYPhotoPicker'
  • 方法二:Download ZIP -> 把GYPhotoPicker文件夹中的所有文件拽入项目中,主头文件为:#import "GYAlbumViewController.h"

example

Example

1.单选

    GYAlbumViewController *vc = [[GYAlbumViewController alloc] init];
    vc.delegate = self;
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
    [self presentViewController:nav animated:YES completion:nil];
    // delegate
    albumViewControllerDidSelectedImages:(NSArray *)images

2.多选

    GYAlbumViewController *vc = [GYAlbumViewController albumViewControllerWithMaxSelectedNum:self.textFiled.text.intValue finishSelectedBlock:^(NSArray *images) {
        self.images = images.mutableCopy;
        [self.collectionView reloadData];
    }];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
    [self presentViewController:nav animated:YES completion:nil];

3.自定义相机

    GYAlbumViewController *vc = [GYAlbumViewController albumViewControllerWithMaxSelectedNum:2 finishSelectedBlock:^(NSArray *images) {
    } takePhotoBlock:^{
        NSLog(@"选择相机时调用,逻辑自定义");
        // 例如:
        [self openCamera];
    }];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
    [self presentViewController:nav animated:YES completion:nil];

About

简单易用的自定义图片选择器,支持单选,多选,自定义照相。

Resources

License

Stars

Watchers

Forks

Packages

No packages published