HGImagePicker 1.0.0

HGImagePicker 1.0.0

测试已测试
Lang语言 Obj-CObjective C
许可协议 MIT
发布上次发布2015年6月

sadiq81 维护。



 
依赖项
AsyncImageView~> 1.5.1
CTAssetsPickerController~> 2.9.3
pop~> 1.0
MSSPopMasonry~> 0.0.1
ALActionBlocks~> 1.0.3
LinqToObjectiveC~> 2.0.0
ReactiveCocoa~> 2.4.7
 

  • 作者:
  • Tommy Sadiq Hinrichsen

是否需要一款能够让您轻松从相册、相机和照片库中添加图片的图片选择器?那么您无需继续寻找。

HGImagepicker 结合了 CTAssetsPickerController 和 Apples UIImagePickerController 的近期照片列表,以模拟消息应用的行为。

Initial Screen Image source picker Photo gallery using CTAssetsPickerController

使用方法

显示 HGImagePickerController

HGImagePickerController *imagePickerController = [HGImagePickerController controllerWithDelegate:self];
imagePickerController.modalPresentationStyle = UIModalPresentationFullScreen;
imagePickerController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:imagePickerController animated:true completion:nil];

当用户确认图像选择时,代理回调

- (void)HGImagePickerControllerDidConfirm:(HGImagePickerController *)controller pictures:(NSArray *)pictures {
   @weakify(self)
   [controller dismissViewControllerAnimated:true completion:^{
       @strongify(self)
       [self.slideShow setImages:[[NSMutableArray alloc] initWithArray:pictures]];
       [self.slideShow start];
   }];
}

当用户取消时,代理回调

- (void)HGImagePickerControllerDidCancel:(HGImagePickerController *)controller {
   @weakify(self)
   [controller dismissViewControllerAnimated:true completion:^{
       @strongify(self)
       UIAlertController *errorController = [UIAlertController alertControllerWithTitle:@"Cancelled" message:@"User cancelled image picking" preferredStyle:UIAlertControllerStyleAlert];
       [errorController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]];
       [self presentViewController:errorController animated:true completion:nil];

   }];
}

感谢 AsyncImageView、CTAssetsPickerController、MSSPopMasonry、ALActionBlocks、LinqToObjectiveC、ReactiveCocoa 的创作者们

要求

安装

HGImagePicker 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:

pod "HGImagePicker"

作者:

Tommy Sadiq Hinrichsen,[email protected]

许可协议:

HGImagePicker 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。