ios - How to determine whether an image was taken from the library or from the camera -
I want to check through a statement if an image is taken from the camera roll or taken by the built-in camera. How can I do this through a statement? Thanks for your help!
code: simply check
- (zero) image picture controller: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) information {if (picker .sourceType == UIImagePickerControllerSourceTypeCamera) {toolbar.hidden = NO; } If (picker.sourceType == UIImagePickerControllerSourceTypePhotoLibrary) {toolbar.hidden = NO; } If (picker.sourceType == UIImagePickerControllerSourceTypeSavedPhotosAlbum) {toolbar.hidden = NO; } Else {toolbar.hidden = YES; } ImgView.image = [for information object: @ "UIImagePickerControllerEditedImage"]; [Self shotgun viewer unpowered: yes complete: zero]; }
sourceType :
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {// image taken with camera} other {// image taken from the camera roll}
Comments
Post a Comment