uiimagepickercontroller

iPhone, “More than maximum 5 filtered album lists trying to register. This will fail.” Error

北城余情 提交于 2019-11-27 13:26:36
When I try to read an image from the photo library I get the error, "More than maximum 5 filtered album lists trying to register. This will fail." The image is not read. Any idea how to fix this? I think you are not checking the source type. You might be doing self.sourceType =UIImagePickerControllerSourceTypePhotoLibrary; If this is the case, then you have to check the source type before assigning it directly. like if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypePhotoLibrary]) { // Set source to the Photo Library self.sourceType

How to open the ImagePicker in SwiftUI?

为君一笑 提交于 2019-11-27 13:20:51
I need to open the ImagePicker in my app using SwiftUI, how can I do that? I thought about using the UIImagePickerController, but I don't know how to do that in SwiftUI. Here's a "rough around the edges" implementation. You need to wrap UIImagePickerController in a struct implementing UIViewControllerRepresentable . For more about UIViewControllerRepresentable , please check this amazing WWDC 2019 talk: Integrating SwiftUI struct ImagePicker: UIViewControllerRepresentable { @Binding var isShown: Bool @Binding var image: Image? class Coordinator: NSObject, UINavigationControllerDelegate,

Delete a photo from the user's photo library?

六月ゝ 毕业季﹏ 提交于 2019-11-27 12:29:50
问题 Is there a way I can delete an image that is loaded into my app from a UIImagePickerController ? I want to be able to delete the image from the user's photo library when the user performs a specific action. I am prompting the user to choose a image from their library, then it gets loaded into my app at which point the app does some shnazzy animation, then actually deletes the image. Please help! 回答1: Yes we can delete a photo. We can use PHAssetChangeRequest for this operation. From Apple: A

iPhone SDK - How to disable the picture preview in UIImagePickerController?

懵懂的女人 提交于 2019-11-27 11:58:14
Is there any way to disable the image preview after taking a picture with the UIImagePickerController? I want to dismiss the ImagePicker as soon as the user pressed the shutter release button. erastusnjuki I asked a similar question here My solution was to create a customized view on top of the default UIImagePickerControllerView. I downloaded the example Augmented Reality Then you can use the OverlayView.m and OverlayView.h by adding them to your project: I made the custom picker toolbar, picker and overlayView global so that I can access them anywhere in the project. In your ViewController.h

UIImagePickerController crash only on iOS 7 - iPad

让人想犯罪 __ 提交于 2019-11-27 11:43:12
问题 I'm getting hundreds of crashes from one of my live apps ever since people started upgrading to iOS 7. Has anyone else seen this problem? Nothing reproduces on my iPad 3 with iOS 7... Link to Crashlytics: crashes.to/s/edf2e71d9a5 Fatal Exception CALayerInvalidGeometry CALayer position contains NaN: [nan nan] 0 ... CoreFoundation __exceptionPreprocess + 130 2 CoreFoundation -[NSException initWithCoder:] 3 QuartzCore CA::Layer::set_position(CA::Vec2<double> const&, bool) + 242 4 QuartzCore -

How to UIImagePickerController for camera and photo library in the same time in swift

放肆的年华 提交于 2019-11-27 11:28:07
I use UIImagePickerController to take a photo by camera of iPhone. I want to show two "take a photo" and "choose a photo". My code imagePicker = UIImagePickerController() imagePicker.delegate = self imagePicker.sourceType = .camera //imagePicker.sourceType = .PhotoLibrary presentViewController(imagePicker, animated: true, completion: nil) I tried to use imagePicker.sourceType = .Camera and imagePicker.sourceType = .PhotoLibrary together to do this, but it doesn't work... Thank you Import UIImagePickerControllerDelegate and create a variable to assign UIImagePickerController var imagePicker =

Presenting a modal view controller immediately after dismissing another

江枫思渺然 提交于 2019-11-27 11:27:56
I'm dismissing a modal view controller and then immediately presenting another one, but the latter never happens. Here's the code: [self dismissModalViewControllerAnimated:YES]; UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; [self presentModalViewController:picker animated:YES]; The first modal VC slides down, but the new picker never comes up. Any idea as to what's going on? Like other animated things, dismissModalViewControllerAnimated doesn't block until the view

Add a circular cropping component for UIImagePicker?

我只是一个虾纸丫 提交于 2019-11-27 11:22:44
问题 I Have a circular framed UIImageView and I need to add a circular framed cropping tool for the UIImagePickerController , after the image is selected from a photo library. Very similar to Instagram's UIImagePicker's crop component. How do I add this type of component? UPDATE I've found this repo with a circular cropping tool https://github.com/ruslanskorb/RSKImageCropper but can someone guide me on to how to implement this cropping tool with the UIImagePickerController after the user selects a

camera overlay view - just for preview?

血红的双手。 提交于 2019-11-27 10:35:27
问题 I've noticed that in OS 3.1 you can add an overlay view to the image picker with cameraOverlayView However, I've also noticed that adding a view via this method also displays the view for the entire time the UIImagePicker is displayed, when I only want to show it during the preview stage. Is there a way to make this only happen during preview? I don't want it to be there during the open shutter animation, or the screen that asks whether you want to use the image or retake. 回答1: I've figured

UIImagePickerController editing view circle overlay

谁说胖子不能爱 提交于 2019-11-27 10:10:33
问题 I've been able to get pretty far with what I've been wanting to accomplish, and that's to replicate iOS's built in circular photo cropper for the built in contacts app. However, I'm stuck at trying to get my CAShapeLayers made correctly. I'm trying to make a transparent 320 px diameter circle and the rest of the view filled with an 0.9 alpha black background. The circle and rectangle are in the right place, but, the circle is not completely transparent like I need it to be. I'm lost as to how