隐私 Privacy - Photo Library Additions Usage Description
Privacy - Photo Library Usage Description
自己加就好
#pragma makr --相册
- (void)selectImageSource {
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;//编辑模式 但是编辑框是正方形的
**// imagePicker.mediaTypes = @[@"public.movie", @"public.image"]; // 重点: public.movie 视频, public.image 图片 **
imagePicker.mediaTypes = @[@"public.movie"];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:imagePicker animated:YES completion:nil];
}
#pragma mark - =======UIImagePickerControllerDelegate=========
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissViewControllerAnimated:YES completion:nil];
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
NSString *type = [info objectForKey:UIImagePickerControllerMediaType];
[self calulateImageFileSize:image];
// info 内容,自己取
// movie
UIImagePickerControllerMediaType = "public.movie";
UIImagePickerControllerMediaURL = "file:///private/var/mobile/Containers/Data/Application/A8CAEB3B-3C6D-4E8C-A4D0-A8C25B775F9D/tmp/233D1C41-0E20-44E0-AA19-0145E500DC3A.MOV";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.MOV?id=A17C4F96-1464-49D5-A91B-61514C8E2886&ext=MOV";
// image
UIImagePickerControllerCropRect = "NSRect: {{0, 270}, {750, 750}}";
UIImagePickerControllerEditedImage = "<UIImage: 0x2813418f0> size {750, 750} orientation 0 scale 1.000000";
UIImagePickerControllerImageURL = "file:///private/var/mobile/Containers/Data/Application/C4083933-AEDE-4201-9418-B49BA258891A/tmp/A4B520C9-66B3-458B-9A2B-493A0015B55D.png";
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x28135c070> size {750, 1334} orientation 0 scale 1.000000";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.PNG?id=EDAEC74E-5654-47A4-88D3-5BC3B5BCF26F&ext=PNG";
}
// 取消图片选择调用此方法
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[picker dismissViewControllerAnimated:YES completion:nil];
}