1. Foreword
On a blog to introduce the objective-c version of the Unlimited carousel package
Here is a swift version of the infinite Carousel
A few lines of code to fix the picture wheel-seeding device
CollectionView multiplexing cell mechanism, regardless of the current section Youdao less item, when the cell width and width of the screen is consistent, the current screen displays up to two cell (picture switch is two cell), switch complete with and only a cell, Even magnified 1000 times times, the maximum load of two cell in memory, so it does not cause memory boom
Wheel-Map loading let
-pointy = UIApplication.shared.statusBarFrame.size.height let
cycleview:cycleview = Cycleview ( Frame:cgrect (x:0, Y:pointy, Width:UIScreen.main.bounds.size.width, height:220))
Cycleview.mode =. Scaleaspectfill
//local picture test-load network picture, please use the third party library such as sdwebimage
Cycleview.imageurlstringarr = ["Banner01.jpg", " Banner02.jpg "," banner03.jpg "," banner04.jpg "]
Tableview.tableheaderview = Cycleview
Added proxy method
Mark:cycleviewdelegate
extension HomeController {
func cycleviewdidselecteditematindex (_ Index:nsinteger {Let
DEMOVC = Democontroller ()
demovc.title = "Click on the Carousel Map \ (index) picture"
DemoVc.view.backgroundColor = Uicolor.white
Navigationcontroller? Pushviewcontroller (DEMOVC, animated:true)
}
}
2. Source Address link
Zycycleviewswift version GitHub link 3. Effect Chart