swift – SwiftPhotoGallery image not change by index in IOS 15.0+


I have created an IOS app in that I am using SwiftPhotoGallery for displaying photos. There is an issue in IOS 15 when I change the image by index.

var gallery = SwiftPhotoGallery(delegate: self, dataSource: self)

gallery.dataSource = self
gallery.delegate = self

gallery.backgroundColor = UIColor.white
gallery.pageIndicatorTintColor = UIColor.gray.withAlphaComponent(0.5)
gallery.currentPageIndicatorTintColor = UIColor(red: 0.0, green: 0.66,
gallery.hidePageControl = true
gallery.modalPresentationStyle = .custom
gallery.transitioningDelegate = self

self.navigationController?.pushViewController(gallery, animated: true)

The below code is not working while changing photos by index in IOS 15.

gallery.currentPage = index
gallery.imageCollectionView.cellForItem(at: IndexPath(item: index,
section: 0))