uiimagepickercontroller

Using UIImagePicker in a tabbed UIPopover

梦想与她 提交于 2019-12-05 08:35:33
I am developing an iPad app that needs to have multiple image sources, on the device/Photo Albums, remote and some included with the app. Now the ideal situation would be to have a UIPopover controller with 3 tabs for each source. The only problem is I can't seem to figure out how to have a UIImagePicker be in its own tab. What I am trying to do is very similar to Apple's Keynote for iPad. The photo icon's popover has tabs and the far left tab called media for sure has a UIImagePicker in there. I have no idea how they did that, is it possible for me to do something like that? I think the main

UIImagePickerController - How do I access the front facing camera by default?

牧云@^-^@ 提交于 2019-12-05 08:33:59
问题 I am bringing up the camera with the following code from my ViewController: - (void)viewDidLoad { self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.sourceType = UIImagePickerControllerCameraDeviceFront; self.imgPicker.delegate = self; } - (IBAction)grabCamera { [self presentModalViewController:self.imgPicker animated:YES]; } How can I make it so the camera by default uses the front camera of the iPhone4 and not the back camera? I tried DeviceFront to no avail. Also, How

Wrong screen size after dismissing UIImagePickerController

纵饮孤独 提交于 2019-12-05 08:14:21
I have an iOS app like whatsapp & ... when I present UIImagePickerController with UIImagePickerControllerSourceTypeCamera source type. imagePicker = [UIImagePickerController new]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.delegate = self; imagePicker.mediaTypes =[NSArray arrayWithObjects:(NSString *)kUTTypeMovie,(NSString *)kUTTypeImage,nil]; [self presentViewController:imagePicker animated:YES completion:nil]; Problem Some times after cancel or finish capturing UIImagePickerController in Video mode , when I back to my viewController (dismiss camera ) my

Uploading an image to a server through imagepicker doesnt work (need solution)

旧城冷巷雨未停 提交于 2019-12-05 08:07:36
问题 As a follow up from this question Uploading images to server doesn't work (There you can find my php file) I realized why it isn't working. But I don't know the solution. As you can see in the code (a few lines down) I give my image to the php file, but it doesnt recognize it as an image. So I hope someone can help with it and knows the (probably obvious) solution: - (IBAction)changepic:(id)sender{ picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType =

UIImagePickerController not asking for permissions on iOS 9

怎甘沉沦 提交于 2019-12-05 07:32:58
I have an iOS app where I present an image picker the self.picker = [[UIImagePickerController alloc] init]; self.picker.delegate = self; self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.popover = [[UIPopoverController alloc] initWithContentViewController:self.picker]; [self.popover presentPopoverFromRect:CGRectMake(100, 100, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; The app however doesn't ask for permissions at all, it just displays the error message "This app does not have access to your photos or videos". Any ideas

Upload large video via NSURLSession causes memory pressure crash

扶醉桌前 提交于 2019-12-05 05:31:22
I use the following codes to upload video to server, which requires me to convert the video from video format to NSData . However, when the video is large (e.g. 10 minute video), the App crashes due to memory pressure. How can I resolve this? - (void)uploadVideo { NSDictionary *params = nil; NSString *NSURLSessionIdentifier = [NSString stringWithFormat:@"%@%@",@"my.bundle.identifier.",[self getTimeString]]; NSURLSessionConfiguration *sessionConfig; // SessionConfiguration With iOS Version if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { sessionConfig =

UIImagePickerController with camera source with allows editing yes : video trimming doesn't work

时光总嘲笑我的痴心妄想 提交于 2019-12-05 04:49:30
I am using UIImagePickerController to record a video with the sourceType set to UIImagePickerControllerSourceTypeCamera . I have set allowsEditing to true. After capturing video I edit the video using the trimming interface and press "Use", I only get back the original recording not the trimmed version. What am I doing wrong? I am using iOS 5. -(void)shootvideo { imagePicker = [[UIImagePickerController alloc] init]; [imagePicker.view addSubview:test]; [imagePicker.view addSubview:test2]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker

How to change button color on UIImagePickerController navigation bar?

家住魔仙堡 提交于 2019-12-05 03:59:06
I have managed to change the color of the navigation bar but the color of the buttons is still black. Is there any way to change the color of the buttons as well? See below image. UPDATE : Sorry had to remove the image due to copy right issue. It is not possible without your custom image. but you should change the tint color as soon as you create the navigation controller: UIImagePickerController *pickerImg = [[UIImagePickerController alloc] init]; pickerImg.navigationBar.barStyle = UIBarStyleBlackOpaque; // Or whatever style. // or pickerImg.navigationBar.tintColor = [UIColor whateverColor];

How to get image name from UIImagePickerControllerPHAsset taken with library or camera?

坚强是说给别人听的谎言 提交于 2019-12-05 01:15:37
I want to get the file name from UIImagePickerControllerPHAsset in ios 11.0.3. unable to get picked image file name using this code. please help on this? if #available(iOS 11.0, *) { let asset = info[UIImagePickerControllerPHAsset] as? PHAsset fileName = ((asset?.value(forKey: "filename")) as? String)! } else { // Fallback on earlier versions let url = info[UIImagePickerControllerReferenceURL] as! URL let assets = PHAsset.fetchAssets(withALAssetURLs: [url], options: nil) fileName = PHAssetResource.assetResources(for: assets.firstObject!).first!.originalFilename } Getting crashes on fileName =

Getting the URL of picture taken by camera with Photos Framework

只愿长相守 提交于 2019-12-04 23:04:46
问题 I have an app that uses a UIImagePickerController to retrieve pictures both from camera and from the photos library. In the image picker delegate I only want to save the NSURL ( UIImagePickerControllerReferenceURL ) of the picked image to save memory. When the user needs to see the image later on, I load it with PHCachingImageManager directly from the photos library. Now - this whole thing works great with pictures the user chooses from the library, but not with pictures directly taken by