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:

  - (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]; }    

simply check sourceType :

  if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {// image taken with camera} other {// image taken from the camera roll}   

Image picture controller: didFinishPickingMediaWithInfo: method.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -