MMBannerLayout
Demo
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
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
}
Installation
MMBannerLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "MMBannerLayout"
Author
[email protected], [email protected]
License
MMBannerLayout is available under the MIT license. See the LICENSE file for more info.