add check for single hiding pager

This commit is contained in:
Pfeil, Scott Robert 2020-06-04 12:10:14 -04:00
parent 57d7a5f7cc
commit 3286cb4292
2 changed files with 3 additions and 1 deletions

View File

@ -193,7 +193,8 @@ open class Carousel: View {
/// Sets up the paging molecule
open func setupPagingMolecule(_ molecule: (CarouselPagingModelProtocol & MoleculeModelProtocol)?, delegateObject: MVMCoreUIDelegateObject?) {
var pagingView: (UIView & CarouselPageControlProtocol)? = nil
if let molecule = molecule {
if let molecule = molecule,
(!molecule.hidesForSinglePage || numberOfPages > 1) {
pagingView = MoleculeObjectMapping.shared()?.createMolecule(molecule, delegateObject: delegateObject) as? (UIView & CarouselPageControlProtocol)
}

View File

@ -11,4 +11,5 @@ import Foundation
public protocol CarouselPagingModelProtocol {
var position: CGFloat? { get }
var hidesForSinglePage: Bool { get }
}