我是iOS
新手,我想访问相机拍照。并将这些图片保存到自定义照片库中。通过谷歌搜索我得到了我想要使用UIImagePickerController
或AVFoundation
Framework.How我可以使用{{1访问相机并将图片保存到自定义照片库中}}
答案 0 :(得分:0)
-(IBAction)camaraBtnPress:(id)sender
{
imagePickerController = [[UIImagePickerController alloc]init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.delegate = self;
[self presentModalViewController:imagePickerController animated:YES];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[imagePickerController dismissModalViewControllerAnimated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image
editingInfo:(NSDictionary *)editingInfo
{
[imagePickerController dismissModalViewControllerAnimated:YES];
//to save in library
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}
按照此link将照片保存在自定义相册
中