Show image or video on same tableview cell? - ios

I want to get either image or video from photolibrary and display on same tableview Cell.
I already get image or video from photo library using imagepickercontroller, but don't know how to display on same cell(suppose user select photo then show photo on cell , if user select video , play video).
Note: I select photo from gallery, and don't want to save it.
Note: I don't want to use any 3rd party library.

After selecting the content identify if it is an image or video. Refer this link .
In the Cell add both imageView and videoPlayer. And hide one of them after selecting.

Related

Photo rotate and crop image swift iOS

I want when user tap on image option appears select from gallery or camera when user select on either gallery or camera after selection I want user can adjust photo through cropping or rotating so anyone help me how I can achieve this functionality.

Photo slider in ios 8

Can you suggest a best library available for photo slider ?
I am getting 400+ photos live url.
Currently i am displaying in uicollectionview.
When user select 150 at row only one photos should be load and open full size. IN that full side next and previous button must be there so user navigate to next photo.
So pls tell me best library name.
Reference . https://github.com/NYTimes/NYTPhotoViewer
Thanks in advance.

Preserve selection between UICollectionViewControllers

I'm developing an iOS app using Swift 2.0. Actually I'm facing a problem using UICollectionViewControllers to select multiple cells and preserve selection.
What I'm trying to do is to provide the user to select their images from Camera Roll, Facebook or Instagram. So far, I present the photo albums to the user in a PhotoAlbumsTableViewController and show the images in a PhotoCollectionViewController after the user select an album. Everything is working correctly until now.
Now, I want to preserve the selected photos on each album after the user returns to the AlbumsViewController to allow the user to select multiple photos on the Camera Roll then get back and select some others on the Instagram album and then click a Done button to show all the selected images. Any ideas?
Thanks in regards.

How to open Saved Photos Album when touch a button? [duplicate]

I am trying to write an app which involves picking a picture from either camera or library. Once the picture is picked , I want to show the preview of the picture.It happens by default when camera is opted. Once the photo is clicked, it shows the user to choose or retake. But I want the same to be done when the picture is selected from the photo library also. Can this be done??
Ok thanks for the response. Here is what I did:
Subclass UIImagePickerController . Upon picking an image, I am pushing another viewcontroller which is similiar to preview screen. This is similiar to facebook app and so I think it will get approved by apple.
I may be wrong, but I think you need to implement the custom view yourself. You can use the delegate callback method to get the selected image and put it on your custom view along with buttons (choose or retake).

how to integrate photos library

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.

Resources