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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?