0
我使用的NSTimer一個UICollectionView連續滾動,這裏是代碼連續滾動UICollectionView iOS時未檢測到點擊?
let timer = NSTimer(timeInterval: 0.1, target: self, selector: #selector(HomeViewController.scrollToNextCard), userInfo: nil, repeats: true)
NSRunLoop.currentRunLoop().addTimer(timer!, forMode: NSDefaultRunLoopMode)
func scrollToNextCard(){
UIView.animateWithDuration(0.1, delay: 0.0, options: UIViewAnimationOptions.CurveEaseInOut, animations: {
// I am changing the contentOffset of collectionview for continuous scrolling
}, completion: {(finished:Bool) in
})
當任何可見細胞的敲擊時滾動過程中,委託的方法didSelectItemAtIndexpath不會被調用。如何在維持滾動收集視圖的同時實現竊聽檢測。請幫助感謝
嘗試'NSRunLoopCommonModes',而不是'NSDefaultRunLoopMode'。 – Santosh
沒有不行。 – coder123