SwiftPhotoGallery
SwiftPhotoGallery copied to clipboard
Update Page Control with Number of Images
Great code, update pageControl when getting "numberOfImagesInGallery" to keep it in sync.
SwiftPhotoGallery.swift file public func collectionView(_ imageCollectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { let numberOfImages = dataSource?.numberOfImagesInGallery(gallery: self) ?? 0 self.pageControl.numberOfPages = numberOfImages return(numberOfImages) }