diff --git a/Sources/FSPagerView.swift b/Sources/FSPagerView.swift index 4b41752..736735f 100644 --- a/Sources/FSPagerView.swift +++ b/Sources/FSPagerView.swift @@ -156,8 +156,12 @@ open class FSPagerView: UIView,UICollectionViewDataSource,UICollectionViewDelega return self.collectionView.alwaysBounceVertical } } + + /// A Boolean value that controls whether the infinite loop is removed if there is only one item. Default is false. + @IBInspectable + open var removesInfiniteLoopForSingleItem: Bool = false { didSet { - self.collectionView.alwaysBounceVertical = self.alwaysBounceVertical; + self.reloadData() } } @@ -191,14 +195,6 @@ open class FSPagerView: UIView,UICollectionViewDataSource,UICollectionViewDelega return self.collectionView.isTracking } - /// Remove the infinite loop if there is only one item. default is NO - @IBInspectable - open var removesInfiniteLoopForSingleItem: Bool = false { - didSet { - self.reloadData() - } - } - /// The percentage of x position at which the origin of the content view is offset from the origin of the pagerView view. open var scrollOffset: CGFloat { let contentOffset = max(self.collectionView.contentOffset.x, self.collectionView.contentOffset.y)