I am trying to do the following:
I've got images, that I get from Facebook directly. Since they are not formatted in the right ratio (square). I want the user to crop it themselves right after getting them.
My Idea: Adding the image to the allowsEditing View from the native UIImagePickerController.
Is this possible?
It's not possible to open native crop. You can only open UIImagePickerController, with allowsEditing = YES and select imaged from local library.
You can use this library to solve your problem:
https://github.com/TimOliver/TOCropViewController
Related
I am new to IOS app development. I have one problem. I have to get an image from the Image Gallery of the iPhone without letting the user select the image. I need to programatically set the image name of the image I need to get the Image. Any one please help me.
You can fetch images from Gallery programmatically using AssetLibrary.
These can be helpful Tutorial1 and Tutorial2
This stackoverflow answer could also be helpful
Once the images are fetch you can select and then set it to any UIImageView
Unfortunately what you'd like to do is not allowed on iOS.
You have to use UIImagePickerController, ask permission from the user, and let the user choose an image.
Check this thread: Access Photo Library via Objective-C/Xcode in iOS
I am using simple default UIImagePickerController but I want the photo library option to be shown in UIImagePickerController as like normal camera in iphone/ipod.
I want to user default imagepicker with out any overlayView.
How can I enable it?
Thank you.
To implement this functionality you will have to use a camera overlay. There are a lot of resources to learn about camera overlay one being http://developer.apple.com/library/ios/#samplecode/PhotoPicker/Introduction/Intro.html
If you really want the default apple UIImagePickerControllerSourceTypeCamera 'look'
1.Set the your uiimagepicker's showCameraControls property to YES.
2.In your customoverlay file(.xib) have nothing but the album button and do what you intend to.
Hope this helps :)
A quick question how do you reverse the order that the camera roll is shown i.e newest images at the top rather than having to scroll all the way to the bottom to get newest image? Alas Facebook image picker?
This works for me in the sense that its just one extra step to select album then images are presented latest first UIImagePickerControllerSourceTypePhotoLibrary rather than UIImagePickerControllerSourceTypeSavedPhotosAlbum
There is one more solution to this
-Using AssetsLibrary frmaework you can have the view completely customised as per your requirement.
Reference :
UIImagepickercontroller: is it possible to change the sort order of the images in camera roll?
I'd like to create a custom image browser in my app that uses the images from the camera roll.
i.e. I'd like to completely replace UIImagePickerController and use my own control.
Is there a way of accessing the camera roll photos in this way?
Cluster App does this but I can't find a picture of it.
You need to use ALAssetsLibrary to access the images.
Have a look at the QBImagePickerController on the GitHub. They implemented custom image picker controller very similar to UIImagePickerController with added multiple selection feature. It will help you. Atleast look at this file
Check out RengarViewController
a custom image picker controller which make use of Photo Framework (introduced in iOS 8).
It has nice UI, can be scrolled and panned.
I want to add iphone-style photo library in my app.
It is like when you open Photos on iphone it shows your album lists.You can click one row and all photos are shown. Touching one, you can see the detail information of the photo and you also can scroll and zoom in/out.
Now I use UIImagePickerController, and I met problem after I selected one image. I don't know how to scroll the image and zoom in/out using apple's API.
If there is no api to do this, I'd like to know how to do it.I can know the original image in
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
But if you want to scroll you should know all the photos in advance, and it seems UIImagePickerController doesn't provide the interface.
Can any one give tips?
thanks!
I mean after selecting one image it just like what you do in iphone's Photos, you can zoom in/out and scroll to the previous or next photo. Sorry for my ambiguous.
You need to allow the user to edit the photo.
To do that, enable the flag allowsEditing on your UIImagePickerController.
UPDATE BASED ON COMMENT:
To create this functionality of browsing the photos on a carousel mode you will need to implement your own custom component. You will need to get access to the photos and then build the functionality yourself.
In order to be able to swipe through images in your library, you would have to use the ALAssetLibrary or Photos Framework (iOS 8 only) to build a custom image picker.
Here's how it should work.
Use either one of these libraries to fetch the photos in the camera roll.
Display the thumbnails of images in a UICollectionViewController.
Display the selected image
in a UIPageViewController. The data source would be the array of images that you have fetched earlier.