paginationuicollectionview

UICollectionView - start viewing from a particular indexpath


I am creating a UICollectionView with paging enabled. Each collection view cell is a full screen image. By default I am able to view the cells from the index 0 (first cell). But I want to start viewing cell from a particular cell index. Can anybody tell me how to do that?


Solution

  • Got it working.

    From the first view controller pass the index path of photo to which you have to scroll. In the ViewDiDLoad of your collection view set up the collection view and then use the method - scrollToItemAtIndexPath:atScrollPosition:animated: Set animated to NO and atScrollPosition to UICollectionViewScrollPositionNone