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
1 answer

Memory Leak AlertController / UIImagePickerController

I have a class to pick a picture from the Gallery or the camera. I opens an alertController and lets you choose between the gallery and the camera. It also contains a delegate. If I choose a picture from the gallery I found a memory leak with…
PaFi
  • 888
  • 1
  • 9
  • 24
1
vote
1 answer

UIImagePickerController not firing delegate method didFinishPickingImage or didFinishPickingMediaWithInfo - iphone

I am having a strange problem on some devices UIImagePickerController not firing delegate method didFinishPickingImage or didFinishPickingMediaWithInfo. I have tested the app on iphone 4 iOS 4.1, iPod 4g and iphone 4.3 application is working…
Naveed Rafi
  • 2,503
  • 5
  • 32
  • 40
1
vote
0 answers

How to pick GIF image using UI Image picker from gallery in swift 4 with all image frame

In my project trying to load GIF from gallery using UI Image Picker, I am getting only the first frame of GIF, I am getting only single Image not the complete frame of images.
1
vote
1 answer

Can UIImagePickerController be used directly on story board?

I have an impression that ViewController usage are similar: on story board, we drag an UIViewController onto scene, then change its class type, e.g. to UIImagePickerController. (I want to make a dedicated scene for picking images) But later I find…
modeller
  • 3,770
  • 3
  • 25
  • 49
1
vote
1 answer

Selecting images with UIImagePickerController() auto-rotates them

In my app, I am importing selected photos from a user's photo library and using them as thumbnails/displaying them in UIImageViews. They are imported and saved to the user's documents folder. The code used is below, however the images are being…
user7987142
1
vote
1 answer

image picker controller not able to change the default crop square size after clicking image from iphone

image showing the imagepickercontroller As shown in this figure, that square position is not changing or resizing when i take picture from camera but it is working from gallery. Please help to how to change the position of crop square to go to…
1
vote
1 answer

I want to use UIPickerImageController inside UINavigationController?

I want to ask that how do I push UIPickerImageController if my app contains UINavigationController, please help me out cz UIPickerImageController has a Navigation so what should I do, so what is apple way to solve this type of problem? you can ask…
Chatar Veer Suthar
  • 15,541
  • 26
  • 90
  • 154
1
vote
1 answer

How to limit UIImagePickerController to only picking portrait mode (depth effect) photos?

I'm building an app that deals with images taken in Portrait Mode (Depth Effect). I need to present UIImagePickerController to only display photos that have depth effect. How do I achieve this?
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
1
vote
1 answer

Video freezing in iphone 6 swift 4.2

I have captured the video for 5 seconds and the video should be in an encrypted format in the local storage of an app. So that I am using RNEncryptor framework for encrypting the video. But sometimes when I click use video button app get a freeze.…
HariKarthick
  • 1,369
  • 1
  • 19
  • 47
1
vote
1 answer

Contacts analogue to UIImagePickerController

In iOS 11+, UIImagePickerController can be used to access the user's photo library without asking permission because it runs as a separate process and does not pose the privacy risk of an app accessing all of the information in the user's photo…
Jake Chasan
  • 6,290
  • 9
  • 44
  • 90
1
vote
1 answer

Driving UIImagePickerController from UITabBarController

Here's my goal: I'd like to show the UIImagePickerController from a TabBarController and once the photo is taken, I want the "Use" button to take me another view controller. My problem: I have MainCameraTabController which inherits from…
Jonas Anderson
  • 1,987
  • 4
  • 24
  • 28
1
vote
1 answer

How to upload image from photolibrary to specific collectionview cell when that cell is selected?

I want to be able to allow users to upload image from photo library to a specific cell in collectionview when it is selected. I have two problems here. (1) I am not sure if I call the cellTapped() function correctly. (2) I want to be able to use tag…
Ricky Geng
  • 177
  • 1
  • 2
  • 10
1
vote
0 answers

Terminated due to memory issue : when I take 5 GB video file from photo library

I was trying to take a video file into my app directory. When I choose 5GB video file by UIImagePickerController, it needs to behold on for a while compressing video. After compressing the app gets crashed on iPad: Communications error: Connection…
Ben
  • 11
  • 1
1
vote
1 answer

How to add multiple selectable images to a UIImagePickerControllerDelegate in a single view?

Good evening, I am trying to create a VC that has three selectable image views. (Meaning the user can click on the box, and it will upload an image from their phone) I am trying to constrain the images next to each other. I would like there to be…
user9951119
1
vote
2 answers

Save ImagePicker File path and Use it as Background

I'm working on a flutter app that allows user to set Background picture of their choice and "stays permanently till the user changes it". Using Image.file(pickedImage) is temporarily, if the user leave the page, and returns back the image would have…
Tayo.dev
  • 1,546
  • 3
  • 21
  • 31
1 2 3
99
100