mma

MMAdvertScrollView

一个简单、轻量级的swift版公告轮播框架

Showing:

Popularity

Downloads/wk

0

GitHub Stars

40

Maintenance

Last Commit

14d ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

MMAdvertScrollView

一个轻量级、简单易用的公告轮播组件

2981628157219_

The realization principle of cyclic rolling

collectionView has 2 sections

start --> indexPath(0, 0) --> indexPath(1, 0) --> indexPath(2, 0) --> ... --> indexPath(n-1, 0) --> indexPath(0, 1) --> indexPath(1, 0)--> indexPath(2, 0)

MMadverstScrollView

image & gif:

1.How to use MMAdvertScrollView

  • Installation with CocoaPods:pod 'MMAdvertScrollView', '~> 1.2.1'
 var timeInterval: TimeInterval = 3.0 // 滚动间隔默认为3秒
 var scrollDirection: UICollectionView.ScrollDirection = .vertical //默认滚动方向为竖向

You can use like this

 let m1 = MMAdvertScrollView(frame: CGRect(x: 0, y: 135, width: UIScreen.main.bounds.width, height: 40))
 m1.dataArray = ["恭喜xx,完成了数据管理能力测评。" ,"恭喜xxxxxxxxxxxxxx,完成实名认证。"]
 view.addSubview(m1)

2.This framework supports custom views

public protocol MMAdvertScrollCustomerViewDelegate: AnyObject{

    func customerViewDataArrayCount() -> Int
    func customViewConfigure(numberOfItems item: Int, cycleView view: MMAdvertScrollView) -> UIView
    func collectionView(_ cycleView: MMAdvertScrollView, didSelectItemAt indexItem: Int) 
    
}

you can refer to CustomerView

extension CustomerView: MMAdvertScrollCustomerViewDelegate {
    func customViewConfigure(numberOfItems item: Int, cycleView view: MMAdvertScrollView) -> UIView {
        let view = VipView()
        view.title = dataArray[item]
        return view
    }

    func customerViewDataArrayCount() -> Int {
        return dataArray.count
    }
}

Remind

  • ARC
  • iOS>=11.0

If you have any questions

If you have any questions, you can email to me:171364980@qq.com

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial