Questions tagged [uiimagepickercontroller]

Questions related to the iOS UIImagePickerController class (and the associated UIImagePickerControllerDelegate protocol), which provides system-supplied user interfaces for taking pictures and movies on iOS devices, and for choosing saved images and movies.

The UIImagePickerController class manages customizable, system-supplied user interfaces for taking pictures and movies on supported devices, and for choosing saved images and movies for use in your app. An image picker controller manages user interactions and delivers the results of those interactions to a delegate object.

The role and appearance of an image picker controller depend on the source type you assign to it before you present it.

  • A sourceType of UIImagePickerControllerSourceTypeCamera provides a user interface for taking a new picture or movie (on devices that support media capture).
  • A sourceType of UIImagePickerControllerSourceTypePhotoLibrary or
    UIImagePickerControllerSourceTypeSavedPhotosAlbum provides a user
    interface for choosing among saved pictures and movies.

To use an image picker controller containing its default controls, perform these steps:

  1. Verify that the device is capable of picking content from the desired source. Do this calling the isSourceTypeAvailable: class method, providing a constant from the “UIImagePickerControllerSourceType” enum.
  2. Check which media types are available, for the source type you’re using, by calling the availableMediaTypesForSourceType: class method. This lets you distinguish between a camera that can be used for video recording and one that can be used only for still images.
  3. Tell the image picker controller to adjust the UI according to the media types you want to make available—still images, movies, or both—by setting the mediaTypes property.
  4. Present the user interface by calling the presentViewController:animated:completion: method of the currently active view controller, passing your configured image picker controller as the new view controller. On iPad, present the user interface using a popover. Doing so is valid only if the sourceType property of the image picker controller is set to UIImagePickerControllerSourceTypeCamera. To use a popover controller, use the methods described in “Presenting and Dismissing the Popover” in UIPopoverController Class Reference.
  5. When the user taps a button to pick a newly-captured or saved image or movie, or cancels the operation, dismiss the image picker using your delegate object. For newly-captured media, your delegate can then save it to the Camera Roll on the device. For previously-saved media, your delegate can then use the image data according to the purpose of your app.

    For details on these steps, refer to Apple's “Taking Pictures and Movies”.

4123 questions
1
vote
0 answers

Custom Tableview Cell Disappears when reloading table with a new picture

I have a very strange issue occurring that I have not seen before while developing. It makes it very difficult to troubleshoot due to the fact the app is not crashing and there is no erroneous debug output in the console window. I have an edit user…
1
vote
0 answers

Swift 4, iOS - save / load image to device Photos Album (Camera Roll) without compression or unmodified?

The problem I'm working on an app that modifies image bits (precisely adds some data). I would like to save modified image to device photo album (camera roll) and then loaded it from there for further modifications. I implemented functions for…
deevee
  • 1,550
  • 15
  • 21
1
vote
2 answers

UIImagePickerController Camera Source Problem

Ok here is the code that I wrote to display the UIImagePickerController in the camera source. I just declared the myPhotopicker in the header for the property and retain it. Synthesized it in the main code file. Then calling the picker I wrote the…
GeneCode
  • 7,545
  • 8
  • 50
  • 85
1
vote
2 answers

Change cancel button text in UIImagePickerController

I have a problem. I want to translate the cancel button in a UIImagePickerController. I tried different solutions but none of them worked. Please find my actual code that works for changing title text but not for cancel button : func…
Thomtomdup
  • 33
  • 6
1
vote
2 answers

image_picker: Cancel button not visible in gallery, if camera was accessed first

This is how open gallery and camera in my flutter application. The problem is, I launch camera first then after I open gallery I'm missing cancel button and title on the top in the navigation bar. But if exit and relaunch the app and I opened…
1
vote
3 answers

Get EXC_BAD_ACCESS when accessing image's properties returned by UIImagePickerController's didFinishPickingImage

I'm working in the simulator right now and when trying to access the attributes of an image returned by UIImagePickerController's didFinishPickingImage, I get an EXC_BAD_ACCESS error: - (void)imagePickerController:(UIImagePickerController *)picker…
Jon Hinson
  • 498
  • 4
  • 6
1
vote
0 answers

Why load Video extention (.3gp) freeze from photoLibrary swift 4

I am trying to select video from PhotoLibrary with extension (.3gp) when I choosing one video.3gp to make app freeze. how to allowed or block that extension files?. I tried so hard but still doesn't work, in debug area and code no error. Update: I…
Jeri P.M
  • 399
  • 5
  • 15
1
vote
1 answer

Generating thumbnail from Video ends up always rotated in an UIImageView

I'm using UIImagePickerController to select a video or an image from the user's gallery. With the photos, there's no problem, everything is displayed the way it should be. The problem comes when I'm trying to generate a thumbnail for a video.…
Dani
  • 3,427
  • 3
  • 28
  • 54
1
vote
1 answer

How do I limit file size for UIImagePickerController?

I am using the following code: func addAttachmentUtil() { print("file attacher") let file = UIImagePickerController() file.delegate = self file.sourceType = UIImagePickerControllerSourceType.photoLibrary file.mediaTypes =…
Enrik Qaz
  • 243
  • 4
  • 14
1
vote
1 answer

Can I take more than one picture with the UIImagePickerController?

I want to offer the user with the possibility of taking more than one picture within the UIImagePickerController, just like the Apple Camera App. The behavior of the controller itself mustnot be changed. So, after the user has chosen to use the…
Nuker
  • 2,577
  • 5
  • 21
  • 32
1
vote
3 answers

iphone store image in application which are chosen from gallery

I searched a lot in google but not able to get the answer required. I am choosing photos from the image gallery and I want to store it in my application. If I have to store it in database(As BLOB), then I have to enter the name of the file(which I…
Droidme
  • 1,223
  • 6
  • 25
  • 45
1
vote
2 answers

swift UIImagePickerController and extracting EXIF data from existing photos

I need to get location data (coordinates for latitude and longitude) from an image picked from PhotoLibrary using UIImagePickerController. Existing answers proposes using fetchAssetsWithALAssetURLs, but it is deprecated for iOS 8 to 11, so I wonder…
just a kid
  • 153
  • 1
  • 11
1
vote
1 answer

UIImagePicker Controller doesn't request permission even with plist entry

I am having trouble with UIImagePickerController. I want to be able to open the photo library and select an image, when I do I get the following error [discovery] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13…
AngryDuck
  • 4,358
  • 13
  • 57
  • 91
1
vote
0 answers

How to find iOS application bugs due to deprecated code?

After selecting a video from the Photo Library I obtained the NSURL of the video with info[UIImagePickerControllerReferenceURL]. if let selectedVideo = info[UIImagePickerControllerReferenceURL] as? NSURL, let videoURLString =…
1
vote
2 answers

One UIImagePickerController for multiple ImageVIews

could you please help me with UIImagePickerController I have 12 ImageViews in 1 ViewController. I need help so that each ImageView could pick different photos from Library. Someone told me to use Tags for them but I can't make it work cause i'm new…
1 2 3
99
100