FAQ Database Discussion Community


How can I get the authorization status to Photo/Camera on IOS?

ios,uiimagepickercontroller
I am using UIImagePickerController. I need tell my users that they need to go to setting->privacy to unlock the camera/photo access if they disagree to give the access the first i want to show them UIImagePickerController. By default, the UIImagePickerController's view will show: But how about i want the message...

set cameraOverlayView with xib

ios,objective-c,iphone,ios7,uiimagepickercontroller
I created a simple xib file with a UIView and a UILabel in the middle of the view. I then set the owner of the xib to be the ViewController that will be using it. I created an outlet from the UIView to my ViewController and did the following: imagePicker.cameraOverlayView...

How to know Camera Is completed taking taking picture In ios

ios,camera,uiimagepickercontroller
Im using image picker controller to present Camera,After image has been taken it’s entering into ending mode, So i want the delegate to call when camera is completed taking picture. Like by means of NSNotificationCenter . UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate=self; picker.allowsEditing = YES; picker.sourceType = UIImagePickerControllerSourceTypeCamera; [self...

image was taken by UIImagePickerControllerSourceTypeCamera how to save it in database in ios

ios,objective-c,xcode,uiimage,uiimagepickercontroller
coding in .m -(IBAction) getPhoto:(id) sender { UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; if((UIButton *) sender == choosePhotoBtn) { picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; } else { picker.sourceType = UIImagePickerControllerSourceTypeCamera; } [self presentModalViewController:picker animated:YES]; } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker...

Why is the status bar sliding back of 20 points my image when I hide it?

ios,swift,uiimagepickercontroller
There appears to be a bug when UIImagePickerController gets called. The status bar shows up even it shouldn't. To workaround that am using subclassing it: class MyImagePickerController: UIImagePickerController { override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) self.setNeedsStatusBarAppearanceUpdate() } override func prefersStatusBarHidden() -> Bool { return true } override func childViewControllerForStatusBarHidden() ->...

UIImagePickerController trim controls not showing

ios,uiimagepickercontroller
I've been unable to get the trim controls to appear when capturing an iOS movie. Here's my code: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.mediaTypes = @[(__bridge NSString *)kUTTypeMovie, (__bridge NSString *)kUTTypeImage]; imagePicker.allowsEditing = YES; imagePicker.delegate = self; [self presentViewController:imagePicker animated:YES completion:nil]; Additionally, I'm capturing the reply...

Camera Overlay not in the center

ios,cocoa-touch,uiimagepickercontroller,overlay
I am trying to add an overlay to this UIImagePickerController instance but the result is the overlay off center. I have created a simple red square (300x300 pt) to exemplify the problem and serve as an overlay and added that to the camera overlay, using this: CGRect bounds = [[UIScreen...

Does anyone know the distance in pixels between the top of the phone screen to the start of the image preview in the camera?

ios,xcode,uiimagepickercontroller
I am trying to build a custom camera overlay and need to know the height of the black toolbar just above the image preview when taking a photo. Does anyone know this? picture below: ...

UIImagePickerController crashes when its delegate is not the view controller

ios,uiviewcontroller,delegates,uiimagepickercontroller
I have an application where I can launch a UIImagePicker from several controllers... To do it right, I have a class to represent the workflow, and this instance is the delegate of the picker... Doing this completely crashes the app. When I set the delegate to the view controller, no...

How to display images that in photo gallery that were just selected?

ios,swift,uicollectionview,uiimagepickercontroller,elcimagepickercontroller
Goal: The user selects photos from her photo gallery > Tap "Done" > Photos show up. Problem: The photos don't show up immediately after "Done". They do show up if I open the picker again and tap "Cancel." This worked fine (photo showed up instantly) when I was using UIImagePickerController,...

nav bar nonresponsive after UIImagePickerController dismissed

ios7,uinavigationcontroller,uinavigationbar,uiimagepickercontroller
On iOS 7 only, the navigation bar in my app does not respond to any touches after a UIImagePickerController is used and then dismissed (whether a pic has been selected or not). The screen below the navigation bar functions as normal, but it is now impossible to navigate Back in...

UIImagePickerController Camera Overlay that matches the default cropping

ios,xcode,swift,uiimage,uiimagepickercontroller
Here's my problem. I'm using UIImagePickerController to take a picture from the camera. After it's been taken (and because I set allowsEditing to TRUE), the preview image shows a white rectangle delimiting the default cropping area (which doesn't appear to be in the center of the picture). What I want...

Save a UIImage on Core Data

objective-c,core-data,uiimage,uiimagepickercontroller,binary-data
How do I save a photo picked by a UIImagePickerController in core data. In my data model I have it set up as Type Binary Data and allows it to store Externally. Here is my code so far. - (IBAction)addPhoto:(id)sender { _picker = [[UIImagePickerController alloc]init]; _picker.delegate = self; _picker.allowsEditing =...

Getting URL of UIImage selected from UIImagePickerController

ios,swift,ios8,uiimagepickercontroller,nsurl
I'm trying to provide a user selection of an image from Photo Library. Thus I'm using UIImagePickerController for selecting. But here comes an issue with getting its initial URL in the file system (I need this for CKAsset). My code. func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) { let...

How to disable the Copy/Hide feature in UIImagePickerController when long pressing a image …?

ios,swift,ios8,uiimagepickercontroller,ios8.3
- Actually am using UIImagePickerController for my usecase,and if i long press any picture ,it shows Copy/Hide option (as shown in the sample image) - I dont want the Copy/Hide feature. Guide me with some suggestions if u too have encountered :)... Thanks in advance...iOS Geeks...PLZ refer my code snippet...

Save recorded video only when 'Save' button is clicked

ios,objective-c,xcode6,uiimagepickercontroller
I'm able to record videos and perform playback on my app using the codes below: - (IBAction)recordVideo:(id)sender { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsEditing = YES; picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil]; [self presentViewController:picker animated:YES...

Keep getting fatal error: unexpectedly found nil while unwrapping an Optional value

ios,swift,uiimagepickercontroller
I keep getting fatal error: unexpectedly found nil while unwrapping an Optional value, whenever I'm done picking a picture Edited version the value of image is there Update2 ...

Setting the image taken from the gallery to the UIImageView

ios,swift,uiimageview,uiimagepickercontroller
The problem am facing is placing the picture i choose from the gallery into theUIImageView (imageChosen). The code runs fine without any errors but the picture i chose is not set to the "imageChosen" here is my code class postChoices: UIViewController { @IBOutlet weak var imageChosen: UIImageView! @IBAction func gallery(sender:...

How to access photos from actual device using UIImagePickerController

ios,swift,uiimagepickercontroller
Currently I am using this code: @IBAction func selectPicture(sender: UIButton) { if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.PhotoLibrary){ var imag = UIImagePickerController() imag.delegate = self imag.sourceType = .Camera; imag.mediaTypes = [kUTTypeImage as String] imag.allowsEditing = false imag.modalPresentationStyle = .Popover self.presentViewController(imag, animated: true, completion: nil) } } But when I run it on the iPad of...

UIImagePickerController front camera show mirror image on preview view

ios,objective-c,uiimagepickercontroller
I know many people had asked this question, but I am not found some correct answer to fix this issue,My problem is : How can I make the photo on preview view(after user tap the capture button,and then go to the preview view to let the user preview) not mirror,...

Is it possible to load UIImagePickerController.Camera with attribute of silent shutter sound

ios,swift,camera,uiimagepickercontroller
I've just learned to implement setting CameraModeFlash.Off when presenting UIImagePickerController.Camera. Is there any way to make the default shutter sound silent??...

Is it possible to take picture using voice command in iOS app?

ios,ios8,uiimagepickercontroller
I created a sample application that uses custom controls to take a picture. Now I want to take a picture using a voice command (like if the user says "capture photo"). Are there any default controls or options in iOS or do we need to implement our own? Any references?

Camera Flash Turn Auto/On/Off with UIImagePickerController in IOS - Swift

ios,swift,uiimagepickercontroller,camera-flash
I am very new to IOS Swift. But I am building a sample camera app that takes picture and video and then saved to photo gallery. But I want user to choose Auto/On/Off Flash option on the Camera View and when the user takes the picture then flash turns on...

How to create GalleryShortcut when presenting UIImagePickerController

ios,objective-c,uiimagepickercontroller,image-gallery
I want to give option for user to take a photo or upload one as his avatar in my app. I believe there is no need to put two different buttons for that, so instead I would like to make the next scenario: user clicks on "Add Picture" button and...

Objective c - ios : How to pick video from Camera Roll?

ios,objective-c,iphone,xcode,uiimagepickercontroller
I try this : UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init]; videoPicker.delegate = self; videoPicker.modalPresentationStyle = UIModalPresentationCurrentContext; videoPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; videoPicker.mediaTypes = @[(NSString*)kUTTypeMovie, (NSString*)kUTTypeAVIMovie, (NSString*)kUTTypeVideo, (NSString*)kUTTypeMPEG4]; videoPicker.videoQuality = UIImagePickerControllerQualityTypeHigh; [self presentViewController:videoPicker animated:YES...

UIImagePickerController shows black bar when zooming – Is this a bug in iOS?

ios,uiimagepickercontroller,screen-orientation,uiinterfaceorientation
Edit: It has been suggested this post is a duplicate, which is not the case as the black bars are not initially present an an affine transformation does not remedy the problem. I run this on an iPad Air 2 and target iOS 8. I have a UIImagePickerController whose showsCameraControls...

How to Save Image to Application Folder from UIImagePickerController?

ios,objective-c,iphone,ios8,uiimagepickercontroller
I've a question in mind that driving me crazy. I've searched a lot to solve it, but all the answers that I found were old and not helped. I'm currently working on application with that uses UIImagePickerControllerDelegate and with didFinishPickingMediaWithInfo I want to save the selected image to application folder....

Having trouble combining two images using UIGraphics, images not correctly positioned

ios,xcode,uiimage,uiimagepickercontroller
I am trying to make a simple app that combines the camera overlay with the photo that is taken in UIImagePicker. In this example I want to combine the overlay view of bear ears with the photo. - (IBAction)pushTakePhoto:(id)sender { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType...

Swift Unbalanced calls to begin/end appearance transitions for

ios,swift,uiviewcontroller,uiimagepickercontroller
This has been stumping me for a while now. I have a UISplitViewController inside a UITabBarController. The master view is a TableView. When I click on a cell, I bring up a very basic view controller with just a UIButton centered. Here is the code for the view controller: class...

Remove “choose from gallary” option in iphone? [duplicate]

ios,iphone,html5,uiimagepickercontroller
This question already has an answer here: iOS Safari Restrict Image Upload 2 answers i am working on project which provides functionality of capturing image from any phone and upload it to websites server. but i am facing problem while using iphone. it shows "Choose from gallary" option as...

Setting delegate for UIImagePicker returns error - swift

ios,swift,delegates,apple,uiimagepickercontroller
Having a problem in some swift code I had written for an OCR translation app. The code snippet is below: @IBAction func btnOCR(sender: AnyObject) { var languageAlert = UIAlertController(title: "For Your Information...", message: "The OCR feature currently only supports English & French.", preferredStyle: .Alert) languageAlert.addAction(UIAlertAction(title: "Okay", style: .Default, handler: {...

How change/create a new source type for UIImagePicker (SWIFT)

ios,xcode,swift,uikit,uiimagepickercontroller
I am new in iOS development and I need help. I use UIImagePicker so that the user selects his image. I want that user selects pictures located in a folder of the application and not the iOS library. All this using UIImagePicker. Is this possible? If I am wrong please...

Follow a UICollectionViewCell

ios,uicollectionview,uiimagepickercontroller,uicollectionviewcell
I have a UICollectionView that is populated by a UIImagePickerControl button that is in a Cell, I want the cell that is on the end of the collection view to be followed by the screen, but still enable user scrolling - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { NSString* imageString...

How do I set an UIImage through a animated UIView to another View Controller in SWIFT

swift,delegates,uiimage,uiimagepickercontroller
I currently have View Controller 1 which has UIImageView and a button placed over the top, when that button is clicked I animate a PopUpViewController which is basically w UIView with buttons, this animates over the top of View Controller 1 var popViewController : PopUpViewControllerSwift! //popViewController declared in View Controller...

How to detect privacy permission changes (Camera access for example)

ios,avfoundation,uiimagepickercontroller,eventkit,photokit
We've all been there. You want to take photos within your app, or access photos, microphone, contacts, etc... But first iOS must prompt the user for permission. In many cases the user will deny access. If your app detects that the user has denied access, you can navigate the user...

Photo framework: save exif data from picker (aperture, focal length, shutter speed, …)

ios,swift,metadata,uiimagepickercontroller,exif
I'm trying to do the equivalent of writeImageToSavedPhotosAlbum with the new Photo framework. To save the image, I only do this: func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) { let image = info[UIImagePickerControllerOriginalImage] as UIImage PHPhotoLibrary.sharedPhotoLibrary().performChanges({ () -> Void in let changeRequest = PHAssetChangeRequest.creationRequestForAssetFromImage(image) }, completionHandler: { (success, error)...

Can't pop UIImagePickerController

ios,objective-c,uiimagepickercontroller
I have a UIImagePickerController with a custom overlay. I am trying to implement a cancel button that will just pop the UIImagePickerController. My code for the setup is below: - (void)tapPhoto { //setup the picker self.picker = [[UIImagePickerController alloc] init]; self.picker.delegate = self; self.picker.sourceType = UIImagePickerControllerSourceTypeCamera; self.picker.cameraDevice=UIImagePickerControllerCameraDeviceFront; self.picker.showsCameraControls=NO; self.cameraOverlay =...

How to convert image which taken by camera (UIImagePickerControllerSourceTypeCamera) to NSData in iOS

ios,objective-c,uiimageview,uiimagepickercontroller,nsdata
Codings that I'm having to get the photo in my UIViewController: -(IBAction) getPhoto:(id) sender { UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; if((UIButton *) sender == choosePhotoBtn) { picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; } else { picker.sourceType = UIImagePickerControllerSourceTypeCamera; } [self presentModalViewController:picker animated:YES]; } following is the function to...

Picking two different images using two different imagePickerControllers Swift

ios,swift,uiimageview,uiimagepickercontroller
I am making an app in which there are two UIImageViews. In each image view the user needs to be able to input a different image. Here is the code I have so far. var imagePicker = UIImagePickerController() @IBAction func chooseImage1(sender: AnyObject) { if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.SavedPhotosAlbum){ println("Button capture") imagePicker.delegate = self...

How to getting into the “All Photos” Albums directly?

ios,objective-c,uiimagepickercontroller,photo
My code is like this: oldPicker = [[UIImagePickerController alloc] init]; if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { oldPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; oldPicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:oldPicker.sourceType]; } oldPicker.delegate = self; oldPicker.allowsEditing = NO; [self presentViewController:oldPicker animated:YES completion:nil]; The effects is when I click the button,it shows me the albums...