Skip to content

Commit df74aa7

Browse files
kahayashkahayash
authored andcommitted
add interface
1 parent ff69be7 commit df74aa7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

PagingKit/PagingMenuViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ public class PagingMenuViewController: UIViewController {
110110
return collectionView.indexPathForItem(at: focusView.center).flatMap(collectionView.cellForItem)
111111
}
112112

113+
public var currentFocusedIndex: Int? {
114+
return collectionView.indexPathForItem(at: focusView.center)?.row
115+
}
116+
113117
public func cellForItem(at index: Int) -> UICollectionViewCell? {
114118
return collectionView.cellForItem(at: IndexPath(item: index, section: 0))
115119
}
@@ -140,7 +144,6 @@ public class PagingMenuViewController: UIViewController {
140144
if let index = index {
141145
collectionView.performBatchUpdates(nil) { [weak self] (finish) in
142146
guard let _self = self else { return }
143-
_self.focusView.layer.removeAllAnimations()
144147
_self.scroll(index: index, percent: 0, animated: false)
145148
completionHandler?(finish)
146149
}

0 commit comments

Comments
 (0)