uiimagepickercontroller

Save Photos to Custom Album in iPhones Photo Library

冷暖自知 提交于 2019-11-27 06:03:14
I'm trying to create a custom album in the Photo Library of an iPhone and then save photos that I've taken with the camera, or chosen from the phones Camera Roll to that custom album. I can successfully create the album but the photos are not getting saved there, instead they are getting saved to the simulators Saved Photos album... I'm not sure how to tell UIImageWriteToSavedPhotosAlbum to save to the new album I've just created using addAssetsGroupAlbumWithName ... Here is the code I have so far - I've snipped out a few sections to keep my code example short... - (void)imagePickerController:

Getting URL of UIImage selected from UIImagePickerController

拥有回忆 提交于 2019-11-27 05:45:47
问题 I'm trying to provide a user selection of an image from Photo Library. Thus I'm using UIImagePickerController for selecting. But here comes an issue with getting its initial URL in the file system (I need this for CKAsset ). My code. func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) { let imageURL = info[UIImagePickerControllerReferenceURL] as NSURL let path = imageURL.path! let imageName = path.lastPathComponent let paths

iPad iOS7 - UIImagePickerController in UIPopoverController has wrong preview image

南笙酒味 提交于 2019-11-27 05:39:25
问题 I am using an UIImagePickerController within an UIPopoverController which is working perfectly with iOS6. With iOS 7 the "preview" image which is shown to capture the image is rotated, but if I take a picture it is saved correctly. This is how I get my picker: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.mediaTypes = [NSArray arrayWithObjects: (NSString

How to get the custom overlay for UIImagePicker camera to be full screen in iOS 7?

試著忘記壹切 提交于 2019-11-27 05:16:03
问题 I am interested in using a custom overlay for the UIImagePickerController for camera controls that take the entire screen, very similar to what the default Camera app does when switched to the video function. I have referenced several questions here on SO on this topic, particularly this one, as well as the Apple example on how to use a custom overlay for the UIImagePickerController, but none of them have been able to produce a successful, full-screen result with iOS 7. So far, this is what

How to allow user to pick the image with Swift?

无人久伴 提交于 2019-11-27 05:06:27
问题 I am writing my first iOS application (iPhone only) with Swift. The main application view should allow user to choose the image from the photo gallery. I've found the following sample code of ViewController.swift : class ViewController: UIImagePickerController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() {

UIImagePickerController in Swift 3

你说的曾经没有我的故事 提交于 2019-11-27 04:50:43
问题 I've recently updated to Swift 3 in Xcode 8 using the developer beta. I'm trying to implement Firebase Auth, and everything's going well. My Problem: I'm trying to upload an image as a user's profile picture to a Firebase database. I thought I could use the UIImagePickerController to do this, but when I do, I get a "Thread 7: Signal SIGABRT I know what this would normally indicate, but I checked, and my image does indeed print my test statement when I tap it. My failed method: ViewController

Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey'

落花浮王杯 提交于 2019-11-27 04:28:25
I'm using Apple's Swift iOS Tutorial . Which is throwing an error, Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey' The function they defined is below. 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[UIImagePickerControllerOriginalImage] as? UIImage else { fatalError("Expected a dictionary containing an image, but was provided the

How to know if iPhone camera is ready to take picture?

我的梦境 提交于 2019-11-27 04:23:41
问题 When [camera takePicture] is called before the camera is ready, it spits out this message: UIImagePickerController: ignoring request to take picture; camera is not yet ready. How can I know when it is ready to take a photo? [camera isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] always returns true, even when it's apparently not ready. 回答1: As @djromero said there is a solution by using AVFoundation (but not instead of UIImagePickerController . You just use AVFoundation to get

Swift 4.2 imagePickerController issue

隐身守侯 提交于 2019-11-27 03:28:09
问题 Trying to pass chat client from swift 4 to swift 4.2 and with picker i found trouble. UIImagePickerControllerEditedImage Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey' func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { if let pickedImage = info[UIImagePickerControllerEditedImage] as? UIImage { self.userProfileImage.contentMode = .scaleAspectFit self.userProfileImage

iOS7 iPad Landscape only app, using UIImagePickerController

你离开我真会死。 提交于 2019-11-27 03:23:25
I believe this is a common issue and many answers don't work anymore, many just partial, if you are under iOS7 and your iPad app is Landscape only, but you want to use the UIImagePickerController with source UIImagePickerControllerSourceTypePhotoLibrary or UIImagePickerControllerSourceTypeCamera . How to set it right, so it's working 100%? And you don't get mixed orientations and avoid the error "Supported orientations has no common orientation with the application, and shouldAutorotate returns YES ". If your iPad app is landscape only in all conditions, just do these 3 steps : 1) In your app