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.
Auto Scroll collectionView smoothly and continuously like Marquee in swift ios
Could you achieve this?? I am also looking for the solution.. –
Rubyeruch
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()
}
}
© 2022 - 2025 — McMap. All rights reserved.