Skip to content

A simple and useful automatic infinite scroll view, more elegant implementation and more friendly API. Support Objective-C and Swift. 一款简单实用的轮播图控件,更优雅的实现,更友好的API。支持 Objective-C 和 Swift。

Notifications You must be signed in to change notification settings

Amy511/ZKCycleScrollViewDemo

 
 

Repository files navigation

ZKCycleScrollViewDemo

A simple and useful automatic infinite scroll view, more elegant implementation and more friendly API. Support Objective-C and Swift.

ScreenShot

image

Features

  • Horizontal and vertical scrolling
  • Cell and PageControl customization
  • Interface Builder

Usage

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let cycleScrollView = ZKCycleScrollView(frame: CGRect(x: 0.0, y: 0.0, width: 375.0, height: 65.0))
        cycleScrollView.delegate = self
        cycleScrollView.dataSource = self
        cycleScrollView.register(CustomCell.self, forCellWithReuseIdentifier: "cellReuseId")
        view.addSubview(cycleScrollView)
    }
}

extension ViewController: ZKCycleScrollViewDataSource {
    
    func numberOfItems(in cycleScrollView: ZKCycleScrollView) -> Int {
        return 5
    }
    
    func cycleScrollView(_ cycleScrollView: ZKCycleScrollView, cellForItemAt index: Int) -> ZKCycleScrollViewCell {
        let cell = cycleScrollView.dequeueReusableCell(withReuseIdentifier: "cellReuseId", for: index) as! CustomCell
        // TODO:
        return cell
    }
}

extension ViewController: ZKCycleScrollViewDelegate {
    func cycleScrollView(_ cycleScrollView: ZKCycleScrollView, didSelectItemAt index: Int) {
        // TODO:
    }
}

Links

Thanks

If possible, please give me a star😘.

About

A simple and useful automatic infinite scroll view, more elegant implementation and more friendly API. Support Objective-C and Swift. 一款简单实用的轮播图控件,更优雅的实现,更友好的API。支持 Objective-C 和 Swift。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%