我想将滚动位置的选项集作为参数参数传递,但面临一些问题。
请任何人都可以写下如何做到这一点?
func selectCurrentWallpaperCell() { //want to pass parameter here
let currentWallpaperID = self.wallpaperManager.currentWallpaperID
if let index = self.wallpapers.index(where: { $0.id == currentWallpaperID }) {
let indexPath = IndexPath(item: index, section: 0)
self.collectionView.selectItem(at: indexPath, animated: true, scrollPosition: UICollectionViewScrollPosition()) // how to use in scrollposition?
}
}