MMBannerLayout

Custom Banner CollectionView Layout

  • 所有者: MillmanY/MMBannerLayout
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

MMBannerLayout

CI Status
Version
License
Platform

Demo

demo

Setting

demo

Use Banner

    if let layout = collection.collectionViewLayout as? MMBanerLayout {
        // Space every Item
        layout.itemSpace = 5.0
        // Size for banner cell
        layout.itemSize = self.collection.frame.insetBy(dx: 40, dy: 40).size
        // scroll to inifite (ex. completed block check your content size is enough to cycle infinite)
       (collection.collectionViewLayout as? MMBanerLayout)?.setInfinite(isInfinite: true, completed: { [unowned self]                    (result) in
            // result false mean you cant infinite
       })
        // auto play
        (collection.collectionViewLayout as? MMBanerLayout)?.autoPlayStatus = .play(duration: 2.0)
        // angle need to be (0~90)
        layout.angle = 45
    }

Use BannerLayoutDelegate

    //(Just setting self.collectionView.delegate = [your target])
    extension [your Target]: BannerLayoutDelegate {
             // Current IndexPath on center
            func collectionView(_ collectionView: UICollectionView, focusAt indexPath: IndexPath) {
                 print("Focus on \(indexPath)")
            }
    }

Installation

MMBannerLayout is available through CocoaPods. To install
it, simply add the following line to your Podfile:

(if you cant find pod command "pod repo update")
pod "MMBannerLayout"

Author

millmanyang@gmail.com

License

MMBannerLayout is available under the MIT license. See the LICENSE file for more info.

主要指标

概览
名称与所有者MillmanY/MMBannerLayout
主编程语言Swift
编程语言Swift (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2017-07-12 17:35:40
推送于2020-02-12 08:02:15
最后一次提交2020-02-12 16:00:33
发布数22
最新版本名称5.0.8 (发布于 )
第一版名称1.0.0 (发布于 )
用户参与
星数176
关注者数6
派生数18
提交数46
已启用问题?
问题数12
打开的问题数7
拉请求数0
打开的拉请求数0
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?