MMBannerLayout 5.0.8

MMBannerLayout 5.0.8

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最新发布2020年2月
SPM支持SPM

MM 维护。



MMBannerLayout

CI Status Version License Platform

示例

demo

设置

demo

使用横幅

    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
    }

使用 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)")
            }
    }

安装

MMBannerLayout 通过 CocoaPods 提供使用。要安装,只需在 Podfile 中添加以下行

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

作者

[email protected]

许可

MMBannerLayout 按照MIT许可提供。更多信息请查看LICENSE文件。