Uiimagepickercontroller Crashes App | Swift3, Xcode8

UIImagePickerController crashes app | Swift3, Xcode8

Add this key to your info.plist,

Key : Privacy - Photo Library Usage Description [ NSPhotoLibraryUsageDescription ]
String Value : We need access to your camera roll and photo library, so that we can do operations on it. [ Customise it in your own way]

That's it, Clean & Run the project.

Sample Image

UIImagePickerController crashes on iOS10

I solved the crash by updating to the latest Xcode version.
The problem has been discussed here as well: https://github.com/Leanplum/Leanplum-iOS-SDK/issues/12

UIImagePickerController in Swift 3

I think you need to add privacy - key for camara and photo library in your info.plist file as from xcode 8. for example,

 Key : Privacy - Media Library Usage Description
Value : YES

Key : Privacy - Photo Library Usage Description
Value : YES

Key : Privacy - Camara Usage Description
Value : YES

here value is string not Boolean.

so try this.

Check Apple documentation for more details!

Reference : this so post

Xcode 8 UIImagePickerController frozen

I figure this out.This is caused by using the wrong delegate method.the one I was using has been DEPRECATED.

We should use this one

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info;

and the image information is in the info dictionary.You can get the image in this way

UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];

Crash when pushing to another controller after `didFinishPickingMediaWithInfo`

The primary cause of your issue is that you are trying to access the outlets of the view controller too soon. The view controller's views and outlets are not created and assigned immediately after instantiating the view controller.

It's also poor design to attempt to directly access the views of a view controller from code outside of that view controller. The proper solution, in this case, is to add a UIImage property that you can set. Then let the view controller update its own image view based on the value of that image property at the proper time (such as in viewDidLoad).

iOS 10 - App crashes To access photo library or device camera via UIImagePickerController

In iOS 10. You have to set privacy Setting for Camera & Photo Library.

Camera :

Key       :  Privacy - Camera Usage Description   
Value : $(PRODUCT_NAME) camera use

Photo Library:

Key       :  Privacy - Photo Library Usage Description    
Value : $(PRODUCT_NAME) photo use


Related Topics



Leave a reply



Submit