Add 'cellForItem(at:)' func to FSPagerView.
This commit is contained in:
parent
e70c8a3c9b
commit
ba3f58f953
|
|
@ -528,6 +528,16 @@ open class FSPagerView: UIView,UICollectionViewDataSource,UICollectionViewDelega
|
||||||
return indexPath.item
|
return indexPath.item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the visible cell at the specified index.
|
||||||
|
///
|
||||||
|
/// - Parameter index: The index that specifies the position of the cell.
|
||||||
|
/// - Returns: The cell object at the corresponding position or nil if the cell is not visible or index is out of range.
|
||||||
|
@objc(cellForItemAtIndex:)
|
||||||
|
open func cellForItem(at index: Int) -> FSPagerViewCell? {
|
||||||
|
let indexPath = self.nearbyIndexPath(for: index)
|
||||||
|
return self.collectionView.cellForItem(at: indexPath) as? FSPagerViewCell
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Private functions
|
// MARK: - Private functions
|
||||||
|
|
||||||
fileprivate func commonInit() {
|
fileprivate func commonInit() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue