测试已测试 | ✗ |
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 |
是否需要一款能够让您轻松从相册、相机和照片库中添加图片的图片选择器?那么您无需继续寻找。
HGImagepicker 结合了 CTAssetsPickerController 和 Apples UIImagePickerController 的近期照片列表,以模拟消息应用的行为。
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 文件。