【发布时间】:2018-04-13 13:34:21
【问题描述】:
我想将滚动位置的选项集作为参数参数传递,但面临一些问题。
谁能写下怎么做?
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?
}
}
【问题讨论】:
标签: ios swift collectionview scroll-position