Detect permission of camera in iOS

Check the AVAuthorizationStatus and handle the cases properly. NSString *mediaType = AVMediaTypeVideo; AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType]; if(authStatus == AVAuthorizationStatusAuthorized) { // do your logic } else if(authStatus == AVAuthorizationStatusDenied){ // denied } else if(authStatus == AVAuthorizationStatusRestricted){ // restricted, normally won’t happen } else if(authStatus == AVAuthorizationStatusNotDetermined){ // not determined?! [AVCaptureDevice requestAccessForMediaType:mediaType completionHandler:^(BOOL granted) { … Read more

iOS 8 Snapshotting a view that has not been rendered results in an empty snapshot

I’m pretty sure this is just a bug in iOS 8.0. It’s reproducible with the simplest of POC apps that does nothing more than attempt to present a UIImagePickerController like you’re doing above. Furthermore, there’s no alternative pattern to displaying the image picker/camera, to my knowledge. You can even download Apple’s Using UIImagePickerController sample app, … Read more

Picking two different images in the same view controller using imagePickerController in Swift

You only need one UIImagePickerController. You can keep a reference of the tapped view and when the user finish picking the image, you just need to cast the selected view as UIImageView and set its image property: update: Xcode 11.5 • Swift 5.2 or later import UIKit class ViewController: UIViewController, UIImagePickerControllerDelegate ,UINavigationControllerDelegate { @IBOutlet weak … Read more

Resizing UIimages pulled from the Camera also ROTATES the UIimage?

The reason your code doesn’t work is because the imageOrientation on the code that you have is not being taken into account. Specifically, if the imageOrientation is right/left, then you need to both rotate the image and swap width/height. Here is some code to do this: -(UIImage*)imageByScalingToSize:(CGSize)targetSize { UIImage* sourceImage = self; CGFloat targetWidth = … Read more

UIImagePickerController and extracting EXIF data from existing photos

Have you took a look at this exif iPhone library? http://code.google.com/p/iphone-exif/ Gonna try it on my side. I’d like to get the GPS (geotags) coordinates from the picture that has been taken with the UIImagePickerController :/ After a deeper look, this library seems to take NSData info as an input and the UIImagePickerController returns a … Read more