I am getting list of data need to show at bottom like new tricker in iOS automatic smooth and continuous Scrolling. how to achieve that kind of behaviour like Marquee to collectionView because I need index position value.
Asked
Active
Viewed 373 times
6
-
Could you achieve this?? I am also looking for the solution.. – Khushabu Oct 06 '22 at 13:31
1 Answers
0
You can try with this code to achieve like marquee collectionview scrolling.
func startCollectionviewScrolling(){
let co = collectionview.contentOffset.x
let no = co + 1
UIView.animate(withDuration: 0.002, delay: 0, options: .curveEaseInOut, animations: { [weak self]() -> Void in
// self?.collectionview.contentOffset = CGPoint(x: no, y: 0)
self?.colWorkoutTypes.scrollRectToVisible(CGRect.init(origin: CGPoint(x: no, y: 0), size: .zero), animated: false)
}) { [weak self](finished) -> Void in
self?.startScrolling()
}
}

RP__
- 1
- 2