uiimagepickercontroller

UIImagePickerController didFinishPickingMediaWithInfo not being called when cameraOverlyView property is assigned

别等时光非礼了梦想. 提交于 2019-12-04 18:37:56
I set up a UIImagePickerController modal view to record a video, and once the user chooses "Use Video" it dismisses the view controller fine and does exactly what I'd like. However, as soon as I add a cameraOverlayView, which is just a UIView with nothing special going on, didFinishPickingMediaWithInfo is never called. Even if I put an NSLog on the first line of that function, I don't see any output. More oddly still, UIImagePickerControllerDidCancel still gets called when the user presses the Cancel button. Prior suggestions on SO do not seem helpful as I have set the delegate and set the

UIImagePickerController stuck on compressing video on iOS10 simulator after choosing a video

☆樱花仙子☆ 提交于 2019-12-04 18:32:03
问题 I had this app that always worked normally on iOS9, now I've migrated the swift code to 3.0 and added the required plist rows to get access to photos library. While trying to pick a video (preloaded by dragging) from the camera roll using UIImagePickerController on simulator it always get stuck on "Compressing Video" and doesn't callback the delegate methods. @IBAction func videoFromLibrary(_ sender: UIBarButtonItem) { picker.allowsEditing = false picker.sourceType = .photoLibrary picker

save image in camera roll and get asset url

妖精的绣舞 提交于 2019-12-04 17:27:19
问题 for an app I'm developing, I use UIImagePickerController to shoot a picture and store it in camera roll: - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info { //... some stuff ... UIImageWriteToSavedPhotosAlbum([info objectForKey:@"UIImagePickerControllerOriginalImage"], nil, nil, nil); } the image is saved, now I need to get its reference url so I try to enumerate camera roll and get the last image, but I always get the image

UIImagePickerController Save to Disk then Load to UIImageView

不打扰是莪最后的温柔 提交于 2019-12-04 16:07:26
I have a UIImagePickerController that saves the image to disk as a png. When I try to load the PNG and set a UIImageView's imageView.image to the file, it is not displaying. Here is my code: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData *imageData = UIImagePNGRepresentation(image); // Create a file name for the image NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setTimeStyle:NSDateFormatterShortStyle];

How to subview a camera view?

前提是你 提交于 2019-12-04 16:03:41
问题 I am making an app that will let the user see themselves in a 'mirror' (the front facing camera on the device). I know of multiple ways of making a UIImageViewController with a view overlay, but I want my app to have it be the opposite way. In my app, I want the camera view to be a subview of the main view, without the shutter animation or the ability to capture photos or take videos and without it being full screen. Any ideas? 回答1: The best way to accomplish this is to not use the built-in

Image Picker Controller delegate in separate class doesn't work

南楼画角 提交于 2019-12-04 16:02:05
I'm new to Xcode and Swift. I'm currently playing around with Start Developing iOS Apps (Swift) tutorial by Apple. Everything works fine so far, except one thing. The tutorial handles Image Picker delegate inside the main ViewController class, making it conform to UIImagePickerControllerDelegate and UINavigationControllerDelegate protocols. I wanted to try something else and move the delegate to separate class. Here's what I did: import UIKit import Foundation class MealPhotoDelegate: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { var placeholder:

iOS take photo from camera without modalViewController

一曲冷凌霜 提交于 2019-12-04 16:01:19
问题 I need get photo from camera, but I need use it in my UIViewController. I have custom button for take photo. I don't want use like this -(void) takePicture:(id) sender { UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; } else { [imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; }

UIImagePickerController Pick Multiple images

ε祈祈猫儿з 提交于 2019-12-04 14:25:19
问题 I am trying to simply enable picking multiple images from photolibrary using the UIImagePickerController, I wish I can add a subview on bottom of the photo picker so it look something like this app does: It there a simple way you can do it? My code currently only pops the images in a standard way but I only dismiss the controller when loaded 6 images The important thing there is if anyway I can add a small view/toolbar to the photo picker view, like the example did, I then can do the rest -

how to save UIImagePicker image with a specific name

泪湿孤枕 提交于 2019-12-04 14:21:24
问题 i capture image from iphone using UIPickerController, then how programatically to save it with specific name, and to call the image later (by using the name), is it any possibilities to change the image size eg. from 100 x 100 pixels to 50 x 50 pixels thanks 回答1: The following code snippet will save the image to a file: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *anImage = [info valueForKey

Record video while other video is playing

橙三吉。 提交于 2019-12-04 13:42:18
问题 I am using UIImagePickerController to record a video. and am using AVPlayer to play a video. and adding AVPlayerLayer to UIImagePickerController's cameraOverlayView so that i can see video while recording. My requirement is I need to watch video while recording video using UIImagePickerController using headset i need to listen audio from playing video need to record my voice to recording video only my voice should be recorded but not playing video's audio. every thing working but 4. audio