Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setCurrentItem #47

Open
ahmtkocamn opened this issue Nov 14, 2018 · 5 comments
Open

setCurrentItem #47

ahmtkocamn opened this issue Nov 14, 2018 · 5 comments

Comments

@ahmtkocamn
Copy link

Hi, I want the cells to start at 3. How can I do that.

@ahmtkocamn ahmtkocamn changed the title setCurrentİtem setCurrentItem Nov 14, 2018
@SocialKitLtd
Copy link

Did you solve it? We are trying to do the same thing but it crashes...

@lex-shvets
Copy link

Same here

@SocialKitLtd
Copy link

Any news about this? We used an ugly/unsafe workaround for now... But It's not stable

@jayBJP
Copy link

jayBJP commented Sep 8, 2020

I have solved it by using following code by setting ContentOffset of collection view.

self.cv_Status.setContentOffset(CGPoint(x:collection_Cell_Width * currnt_Index, y: 0), animated: true)

@alisherFsociety
Copy link

alisherFsociety commented Dec 15, 2021

extension UICollectionView {
    func scrollToIndex(index:Int,section:Int){
        let indexPath = IndexPath(row: index, section: section)
        self.selectItem(at: indexPath, animated: true, scrollPosition: .centeredHorizontally)
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants