uiimagepickercontroller

SwiftUI Full-Screen UIImagePickerController (Camera)

北慕城南 提交于 2021-01-03 07:08:23
问题 I present a UIImagePickerController within my application by presenting it with logic inside of a sheet modifier. In short, the following three types handle displaying and dismissing a instance of UIImagePickerController inside of a UIViewControllerRepresentable type, which works as expected: struct DetailsView: View { enum Sheet: Hashable, Identifiable { case takePhoto var id: Int { hashValue } } @State private var activeSheet: Sheet? var body: some View { Text("Hello, World!") .sheet(item:

UIImagePickerController how to do animated switch from rear to front camera?

旧巷老猫 提交于 2020-06-10 07:27:49
问题 I have been using custom overlay for UIImagePickerController controller, and everything is working fine. I have added button to switch between front and rear camera via - - (IBAction)changeCamera:(id)sender { if (self.imagePicker.cameraDevice == UIImagePickerControllerCameraDeviceRear) { self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront; } else { self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceRear; } } Problem is, switch is not animated. I have been

UIImagePickerController extension discovery failed with error: (null)

吃可爱长大的小学妹 提交于 2020-03-20 05:58:10
问题 I'm trying to implement an ImagePicker on my ViewController, but turns out it presents a blank ImagePicker Controller and UIImagePickerController extension discovery failed with error: (null) message on the console. I have no idea what I'm doing wrong, and I found no information on the matter. One thing I noticed, though, is that the PickerView takes a little bit too long to be presented. The code related to the ImagePicker is the following: private let imagePicker = UIImagePickerController()

iOS 使用UIImagePickerController 拍照

瘦欲@ 提交于 2020-03-14 11:24:58
在项目开发的过程中,我们经常会使用的iPhone 或者 iPad 的拍照功能,比如给用户设置头像,一般都会用到拍照功能。我们可以使用UIImagePickerController 类来调用iPhone的摄像头进行拍照或者录视频。iOS 已经为我们封装好了UIImagePickerController ,使用很简单,让我们不用花费很多时间就可以调用拍照功能。使用UIImagePickerController时,需要实现UIImagePickerController协议。 在xib中添加一个按钮,绑定按钮的响应事件,在响应事件中添加如下代码: UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera; //判断是否有摄像头 if(![UIImagePickerController isSourceTypeAvailable:sourceType]) { sourceType = UIImagePickerControllerSourceTypePhotoLibrary; } UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];

UIImagePickerController not respecting video maximum duration on iPad

放肆的年华 提交于 2020-03-02 05:29:34
问题 I am trying to build an app that would let user pick and upload a video from the library on iPad. I need the max video length to be 30 sec. I am using the following code: UIImagePickerController *mediaPicker = [[UIImagePickerController alloc] init]; mediaPicker.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeMovie,(NSString *)kUTTypeImage,nil]; mediaPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; mediaPicker.videoQuality =

UIImagePickerController and iCloud photos

只愿长相守 提交于 2020-02-25 03:01:10
问题 After switching to iCloud Photo, it seems that some of the images returned by UIImagePickerController are very blur. It looks like the image are taken from iCloud Photo. Am I able to retrieve the original image, or filter off iCloud Photo images, or do I have to switch to other frameworks to do what UIImagePickerController do? 回答1: From the symptoms, I'm going to assume you are using something like this to load your images: func imagePickerController(_ picker: UIImagePickerController,

Photo-library plugin crash in ios version 13

廉价感情. 提交于 2020-02-06 07:54:48
问题 Reposted: question link app crashes when the user wants to fetch images from the library in ionic 3. image picker plugin works fine in iOS 12. But after updating to iOS 13, it is crashing. it is working in iPhone X but when trying it on iPad it's getting the error which is in the link given above. can anyone help with this? Thanks in advance! 回答1: Just add property in ImagePicker options: disable_popover: true It will solve the crashing issue.But the error still would be there in logs! Happy

Photo-library plugin crash in ios version 13

a 夏天 提交于 2020-02-06 07:54:05
问题 Reposted: question link app crashes when the user wants to fetch images from the library in ionic 3. image picker plugin works fine in iOS 12. But after updating to iOS 13, it is crashing. it is working in iPhone X but when trying it on iPad it's getting the error which is in the link given above. can anyone help with this? Thanks in advance! 回答1: Just add property in ImagePicker options: disable_popover: true It will solve the crashing issue.But the error still would be there in logs! Happy