Swift version 4.0 unlimited carousel map

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.