You can access the photo library using the Photos framework (for iOS 8+). Take a look at this example. In the AAPLRootListViewController code, if the awakeFromNib method you can see how to create a PHFetchResult object to retrieve specific photo data. Then, in the AAPLAssetGridViewController, PHAsset objects (from PHFetchResult) are used to retrieve the actual image data. Take a look at the method
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
The code is written in Objective-C, not Swift, but you can do the same with Swift. Ask questions, if any.
source share