Move To Nect Cell Of Collection After Some Time Automatically

[Solved] Move To Nect Cell Of Collection After Some Time Automatically | Swift - Code Explorer | yomemimo.com
Question : move to nect cell of collection after some time automatically in ios swift

Answered by : combative-cardinal-vfofi12ltilc

 /** Scroll to Next Cell */ func scrollToNextCell(){ //get Collection View Instance let collectionView:UICollectionView; //get cell size let cellSize = CGSizeMake(self.view.frame.width, self.view.frame.height); //get current content Offset of the Collection view let contentOffset = collectionView.contentOffset; //scroll to next cell collectionView.scrollRectToVisible(CGRectMake(contentOffset.x + cellSize.width, contentOffset.y, cellSize.width, cellSize.height), animated: true); } /** Invokes Timer to start Automatic Animation with repeat enabled */ func startTimer() { let timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: Selector("scrollToNextCell"), userInfo: nil, repeats: true); }

Source : https://stackoverflow.com/questions/36588933/collectionview-move-to-next-cell-automatically-swift | Last Update : Tue, 09 Mar 21

Answers related to move to nect cell of collection after some time automatically in ios swift

Code Explorer Popular Question For Swift