Reduce accessibility of 'currentIndex setter' of FSPagerView from internal to 'fileprivate'.

This commit is contained in:
WenchaoD 2018-10-11 14:06:17 +08:00
parent 08daae1d4c
commit ebae2a5c73
2 changed files with 2 additions and 3 deletions

View File

@ -265,12 +265,11 @@ class FSPagerViewLayout: UICollectionViewLayout {
guard let collectionView = self.collectionView, let pagerView = self.pagerView else {
return
}
let currentIndex = max(0, min(pagerView.currentIndex, pagerView.numberOfItems - 1))
let currentIndex = pagerView.currentIndex
let newIndexPath = IndexPath(item: currentIndex, section: pagerView.isInfinite ? self.numberOfSections/2 : 0)
let contentOffset = self.contentOffset(for: newIndexPath)
let newBounds = CGRect(origin: contentOffset, size: collectionView.frame.size)
collectionView.bounds = newBounds
pagerView.currentIndex = currentIndex
}
fileprivate func applyTransform(to attributes: FSPagerViewLayoutAttributes, with transformer: FSPagerViewTransformer?) {

View File

@ -214,7 +214,7 @@ open class FSPagerView: UIView,UICollectionViewDataSource,UICollectionViewDelega
return self.collectionView.panGestureRecognizer
}
@objc open internal(set) dynamic var currentIndex: Int = 0
@objc open fileprivate(set) dynamic var currentIndex: Int = 0
// MARK: - Private properties