uiimagepickercontroller

how to use UIImagePickerController in an app which support Landscape orientation only in iOS-6?

隐身守侯 提交于 2019-12-02 00:05:24
问题 I am developing an app which supports Landscape orientation only. It uses an UIImagePickerController to pick images and/or videos from the library. App is functioning fine in iOS-5 or before but it gets crashed when I try to present image picker controller.It gives the following message after crashing: * Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is

Getting crash after picking images from UIImagePickerController (Related to memory leak?)

拈花ヽ惹草 提交于 2019-12-01 21:49:45
问题 I have been trying to minimize my memory footprint with UIImagePickerController , but I'm starting to think that the memory problems I am having are resulting from poor memory management, instead of a particular way to handle the UIImagePickerController object. My workflow is this: The "Edit Image" button is clicked, which presents a UIActionSheet . This action sheet allows you to delete, take a picture, choose from the library, or cancel. If you select Choose from the library or Take Picture

saving an image to photos library using Swift 2.0

情到浓时终转凉″ 提交于 2019-12-01 20:39:05
问题 I'm getting a problem highlighted in red above. When I take a picture and press use photo, it won't let me save the photo I took to the photo album on my iPad. I have looked at other ways but me being a beginner to iOS development, I'm unsure of how to fix this problem. I sometimes get a sigabrt error too. 回答1: Have you provided the completion Selector? ... UIImageWriteToSavedPhotosAlbum(imageView.image!, self, "image:didFinishSavingWithError:contextInfo:", nil) ... func image(image: UIImage,

saving an image to photos library using Swift 2.0

荒凉一梦 提交于 2019-12-01 19:24:35
I'm getting a problem highlighted in red above. When I take a picture and press use photo, it won't let me save the photo I took to the photo album on my iPad. I have looked at other ways but me being a beginner to iOS development, I'm unsure of how to fix this problem. I sometimes get a sigabrt error too. Have you provided the completion Selector? ... UIImageWriteToSavedPhotosAlbum(imageView.image!, self, "image:didFinishSavingWithError:contextInfo:", nil) ... func image(image: UIImage, didFinishSavingWithError error: NSError?, contextInfo:UnsafePointer<Void>) { if error == nil { let ac =

UIImagePickerController Cropping?

一曲冷凌霜 提交于 2019-12-01 18:51:10
问题 I have read that it is automatic but it doesn't appear to be happening in my case. Using UIImagePickerController with allowsEditing set to YES I get my editing view with the crop square overlay, but when i am finished with the image its not cropped as I expect. Should it be automatic at this stage? If not, what might be a good solution to crop the image in the matching area that the default view provides? Thanks. 回答1: You are probably using the wrong key for the info dictionary:

iOS Create custom photo album in Photos (addAssetsGroupAlbumWithName under iOS 5?)

旧街凉风 提交于 2019-12-01 18:48:05
问题 I wanted to know if its anyhow possible to create your own photo album in the iDevice's photo library ? I know ALAsset's addAssetsGroupAlbumWithName:resultBlock:failureBlock: , but it only works in iOS >= 5.0 . Is there a method that could support at least 4.3 ? 回答1: Creating customs albums is only created under ios 5. It's not possible under ios 4. Even the official apple photo app does not have a feature to create albums in the device itself under ios 4. Under ios 4 the only way to create

How to detect user has clicked Don't Allow access to camera

随声附和 提交于 2019-12-01 18:08:09
I am using a UIImagePicker to present the users with camera to take photos which will be used in the app. My problem is that on the first time a user opens the image picker they are presented with a prompt saying: '"my App" Would like to Access your Camera' with two options, Don't allow and OK. My requirement is that when the user clicks Don't Allow, the Image picker gets dismissed leaving a black view. Is there a way to detect that the user has chosen Don't allow? Here is my code to present UIImagePicker : var PhotoPicker:UIImagePickerController = UIImagePickerController() PhotoPicker

How to use UIAutomation to select image from UIImagePickerController

 ̄綄美尐妖づ 提交于 2019-12-01 17:49:30
We are trying to get a UIAutomation test around a flow in our app where a user selects an image from a UIImagePickerController. All the automation works great, until we try to select an image from the picker controller. It seems like we cannot get the right object to send the tap to. Here is what we are trying: UIALogger.logMessage("Navigation Title: " + app.navigationTitle() ); window.collectionViews()[0].tapWithOptions({tapOffset:{x:0.5, y:0.5}}); The above will show the navigation title as "Moments", which means we are in the photo picker, but the second line gets no error - but does not

UIImagePickerController Cropping?

蓝咒 提交于 2019-12-01 17:43:38
I have read that it is automatic but it doesn't appear to be happening in my case. Using UIImagePickerController with allowsEditing set to YES I get my editing view with the crop square overlay, but when i am finished with the image its not cropped as I expect. Should it be automatic at this stage? If not, what might be a good solution to crop the image in the matching area that the default view provides? Thanks. You are probably using the wrong key for the info dictionary: UIImagePickerControllerOriginalImage . To get the cropped (yes, it is automatic) image you have to use

UIImagePickerController stuck at compressing Video

不问归期 提交于 2019-12-01 16:56:44
I've got the image picker working in a popover on the ipad, but when running in the simulator when I select a video in the picker it says its compressing and then gets stuck. Nothing happens, the delegate function never gets called. I found one solution - it works on the physical device. I dont know why it crashes on the simulator, but if I run the app on my Ipad it works fine. It's a late answer but you can fix it by following this procedure: go to the simulator hardware menu and select TV out: 640x480 after that try to run your app from xcode and then again go to the simulator hardware menu