uiimagepickercontroller

How to fix UIImagePickerController crash after switching to video capture mode?

给你一囗甜甜゛ 提交于 2021-02-19 04:28:06
问题 I have a crash with UIImagePickerController on iPhone XR(iOS 12.4.1) real device after switching to video capture mode. Crash reproduces on the second presentation of UIImagePickerController. Crash does not reproduce on iPhone 6(iOS 12.4.1) real device. Camera and Microphone usage description keys are set in Info.plist Test app built with Xcode 10.3 Steps: Present UIImagePickerController Dismiss UIImagePickerController Present UIImagePickerController Tap VIDEO button - > Crash Crash does not

iOS UIImagePickerController showed blank page

蓝咒 提交于 2021-02-10 09:58:07
问题 I tried to present and dismiss the UIImagePickerController continuity Here is my code var imagePicker = UIImagePickerController() func viewDidLoad() { super.viewDidLoad() imagePicker.allowsEditing = false imagePicker.delegate = self } func showImagePickerController() { imagePicker.sourceType = .photoLibrary present(self.imagePicker, animated: true) } // MARK: - UIImagePickerControllerDelegate private func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo

UImage? isn't convertible to UIImage: Xcode throws error when trying to use original image

亡梦爱人 提交于 2021-02-08 12:02:30
问题 func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { // The info dictionary may contain multiple representations of the image. You want to use the original. guard let selectedImage = info[.originalImage] as? UIImage else { fatalError("Expected a dictionary containing an image, but was provided the following: \(info)") } // Set photoImageView to display the selected image. photoImageView.image = selectedImage // Dismiss the picker.

info[UIImagePickerController.InfoKey.mediaURL] is sometimes nil

我是研究僧i 提交于 2021-02-08 05:12:37
问题 I am having a picker, and after successfully picking of video, I can't get a path to the asset. So I have this: func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { if let videoURL = info[UIImagePickerController.InfoKey.mediaURL] as? URL { MediaManager.shared.sourceType = picker.sourceType self.metadata.videoURL = videoURL } } Generally in videos saved with the phone, or even many videos uploaded through

info[UIImagePickerController.InfoKey.mediaURL] is sometimes nil

人盡茶涼 提交于 2021-02-08 05:09:37
问题 I am having a picker, and after successfully picking of video, I can't get a path to the asset. So I have this: func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { if let videoURL = info[UIImagePickerController.InfoKey.mediaURL] as? URL { MediaManager.shared.sourceType = picker.sourceType self.metadata.videoURL = videoURL } } Generally in videos saved with the phone, or even many videos uploaded through

How to run imagePicker in tableViewCell

和自甴很熟 提交于 2021-02-07 19:32:04
问题 I have a tableView with a cell. In this cell I have an imageView, and a button covering it. The button has an IBAction. When tapped, the button is supposed to summon the imagePicker. The IBAction code is located in the cell subview. @IBAction func MyStatusImageButtonAction(sender: AnyObject) { // Select Image let imagePicker = UIImagePickerController() imagePicker.delegate = self imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary imagePicker.allowsEditing = false self

How to run imagePicker in tableViewCell

对着背影说爱祢 提交于 2021-02-07 19:31:14
问题 I have a tableView with a cell. In this cell I have an imageView, and a button covering it. The button has an IBAction. When tapped, the button is supposed to summon the imagePicker. The IBAction code is located in the cell subview. @IBAction func MyStatusImageButtonAction(sender: AnyObject) { // Select Image let imagePicker = UIImagePickerController() imagePicker.delegate = self imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary imagePicker.allowsEditing = false self

How do I mirror a UIImage picture from UIImagePickerController

十年热恋 提交于 2021-02-06 15:16:25
问题 I'm trying to figure out if there is any way to mirror an image. For example, take a picture of someone's face and then cut it in half and show what their face looks like with each side mirrored. There doesn't seem to be any tricks like this in CGAffineTransform functions. Graphics experts please help!!! 回答1: The basic "trick" here is to use a scaling transform about the X or Y axis with a factor of -1. For example, you could use this to create a "flip about the horizontal axis" transform:

How do I mirror a UIImage picture from UIImagePickerController

孤街醉人 提交于 2021-02-06 15:14:02
问题 I'm trying to figure out if there is any way to mirror an image. For example, take a picture of someone's face and then cut it in half and show what their face looks like with each side mirrored. There doesn't seem to be any tricks like this in CGAffineTransform functions. Graphics experts please help!!! 回答1: The basic "trick" here is to use a scaling transform about the X or Y axis with a factor of -1. For example, you could use this to create a "flip about the horizontal axis" transform:

How do I limit file size for UIImagePickerController?

落爺英雄遲暮 提交于 2021-01-29 09:11:40
问题 I am using the following code: func addAttachmentUtil() { print("file attacher") let file = UIImagePickerController() file.delegate = self file.sourceType = UIImagePickerControllerSourceType.photoLibrary file.mediaTypes = ["public.image", "public.movie"] file.videoMaximumDuration = 5.0 file.allowsEditing = false self.present(file, animated: true) { } } However I also want to limit the file on the basis of size (which would be 25 MB). I am not able to understand how to do this? Help is much