[Swift] Photo Gallery for iOS

Hello community!


I wanted to ask if it is possible to make a Photo Gallery in a CollectionView and when the user taps on a photo it opens in a (detail) ViewController, however, I do NOT want the photos to come from the device's photo library, but rather images that I set in the Assets folder in the project.
All the tutorials I have found online explain how to make a photo gallery and show the device's photos when I just want to set a photo gallery of a bunch of photos for the users to view.

Any sample code and explanations will be greatly appreciated.


Aaron

Accepted Reply

when the user taps on a photo it opens in a (detail) ViewController

you could just create a segue between the cell and the destination view. In prepare for segue, you get the cell reference to pass the right parameters to the destination (image name as defined in XCAssets)

Replies

when the user taps on a photo it opens in a (detail) ViewController

you could just create a segue between the cell and the destination view. In prepare for segue, you get the cell reference to pass the right parameters to the destination (image name as defined in XCAssets)