move to nect cell of collection after some time automatically in ios swift code example
Example: move to nect cell of collection after some time automatically in ios swift
func scrollToNextCell(){
let collectionView:UICollectionView;
let cellSize = CGSizeMake(self.view.frame.width, self.view.frame.height);
let contentOffset = collectionView.contentOffset;
collectionView.scrollRectToVisible(CGRectMake(contentOffset.x + cellSize.width, contentOffset.y, cellSize.width, cellSize.height), animated: true);
}
func startTimer() {
let timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: Selector("scrollToNextCell"), userInfo: nil, repeats: true);
}