I'm developing a camera application where I'd like to put some functions that are already present in the stock app. My problem is replicating the little square in the bottom left corner (in portrait mode) where the micro-thumbnail of the photo that the user has just taken is shown; then, when the user tap on it, the photo app should open, on the last photo saved in the camera roll.
I can load the thumbnail of the newest photo in camera roll with ALAssetsLibrary - I've access to it with [UIImage imageWithCGImage:[result thumbnail]] - but even if I have its ALAsset URL, I can't open the photo app. I'm trying to do it with:
[[UIApplication sharedApplication] openURL:result.defaultRepresentation.url];
But nothing happens.
I could display it internally in my app, with an additional UIView, but I think will be simpler and... smarter to use the official photo app!
Can anyone help me? Thank you in advance!
You may want to use the UIImagePickerController, as answered here: https://stackoverflow.com/a/11078182/883413
Related
I am trying to get image from camera and send it to the server automatically.
So I want to know how to capture image from iphone camera scene without press shoot button.
Please help.
Thanks.
How to save photos taken using AVFoundation to Photo Album?
I use this code and solve problem.
https://developer.apple.com/library/content/samplecode/AVCam/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010112
AV Cam-iOS also can solve my problem.
Thank you everyone.
I don't think it is possible. Capturing image using Camera interface will trigger UIImagePickerControllerDelegate methods. The delegates are only called when you pick an image through camera shutter button/image cropper.
I am working on a camera app. I need to adapt the same behavior of the default camera app which opens camera roll when you tap the image on the left corner.
How I can launch camera roll as the default app does? I do not want to get an image, so I don't need to use the UIImagePickerController
Thanks in advance
You can use Photos Framework Available from iOS 8.Using this framework,you will get direct access to photos.You can build your own image editing apps using this Framework.
Please download the sample code from this link :
Photos framework sample code
I'm adding a button that opens a view of the saved images on device, but also has a button to open the camera. The iOS Facebook app currently does this.
I've played with both AVCapture to create my own camera ui and UIImagePickerController to use the default UI but have been unable to find a view that displays both the saved images and camera button.
My question is, did facebook implement their own image picker or is it an Apple included library?
Thanks!
Facebook has their own imagepicker subclass but that doesnt matter for you - just implement a different method for each button that changes the imagepickertype to UIImagePickerControllerSourceTypeCamera or UIImagePickerControllerSourceTypeSavedPhotosAlbum and then displays the picker.
This came across this control AQPhotoPicker. Hopefully it will help you, it's easy to use
I have a UIImagePickerController that is used to upload images to a database. It loads photos from two sources, the camera and the camera roll. When I load the photo from the camera it allows me to take a photo and select if I want to retake the photo or use it. When I load the photos from the camera roll I can select what photo library I want to use but only get a tiled preview of all photos in the library. When I click on the tiled photo preview it gets loaded to the database automatically with no full preview. How can I make it so that when I load a photo from the camera roll it allows me to preview the image before using it in a similar fashion to how it loads from the camera? Here is the coe that I use to specify the UIImagePickerController type, data source and initial settings.
UIImagePickerController *imgPicker = [[UIImagePickerController alloc] init];
imgPicker.delegate = self;
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:imgPicker animated:YES completion:nil];
You have two options:
You can use the allowsEditing property, set it to YES and the final step will be a “preview” of the picked photo. Of course the user can move and scale the photo from that preview, so maybe this is not what you want.
Code your own preview. It will be a simple view controller that you will push into the UIImagePickerController when the user chooses a photo from the gallery. The simplest solution will be just an UIImageView covering all the screen, and two buttons in the navigation bar to choose another photo or choose the previewed one.
Hey thanks for all the help! I ended up using the third party libraries described here: https://github.com/gekitz/GKImagePicker. The GKImagePicker libraries allow you to easily define an editable and scalable area in the same manner as the allowsEditing does.
Is there any way to jump into photo library ?
I'm not asking about UIImagePicker.
In original camera app of iPhone, when I touch a thumbnail of one of the last photos (at the bottom left corner), it goes into photo library (actually, camera roll).
Is that private API or can i use it somehow? Well, I think I can implement that using ALAsset but I'm just wondering if there is any API
I believe you can launch the photo app, in order to view it as you would normally. However you cannot return to your app after launching the photo library.
You'll need to launch com.apple.camera