Remove an redundant property.

This commit is contained in:
WenchaoD 2018-10-06 08:51:05 +08:00
parent c72899860d
commit d3544d8076
1 changed files with 1 additions and 2 deletions

View File

@ -24,7 +24,6 @@ class FSPagerViewLayout: UICollectionViewLayout {
return self.collectionView?.superview?.superview as? FSPagerView
}
fileprivate var isInfinite: Bool = true
fileprivate var collectionViewSize: CGSize = .zero
fileprivate var numberOfSections = 1
fileprivate var numberOfItems = 0
@ -267,7 +266,7 @@ class FSPagerViewLayout: UICollectionViewLayout {
return
}
let currentIndex = max(0, min(pagerView.currentIndex, pagerView.numberOfItems - 1))
let newIndexPath = IndexPath(item: currentIndex, section: self.isInfinite ? self.numberOfSections/2 : 0)
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