Search code examples
iosobjective-cuicollectionviewnsdocumentdirectory

UICollectionView show images stored in documents directory


Hello I can get a UITableView to display the file name of images stored in the documents folder. Is there any way to get a UICollectionView to display these images in a collection view?

Thanks Liam


Solution

  • Yes you can. Here is a UICollectionView Programming Guide.

    1. Create array of file names
    2. Connect data source to UICollectionView
    3. In collectionView:cellForRowAtIndexPath: return cell with image using +imageNamed: method.

    Remember to create custom cell with UIImageView inside, create outlet.

    Here is Tutorial which should help you.