File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Sources/Navigator/Toolkit Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,16 @@ final class PaginationView: UIView, Loggable {
302302 guard 0 ..< pageCount ~= index else {
303303 return false
304304 }
305+
306+ if currentIndex == index {
307+ scrollToView ( at: index, location: location, completion: completion)
308+ } else {
309+ fadeToView ( at: index, location: location, animated: animated, completion: completion)
310+ }
311+ return true
312+ }
305313
314+ private func fadeToView( at index: Int , location: PageLocation , animated: Bool , completion: @escaping ( ) -> Void ) {
306315 func fade( to alpha: CGFloat , completion: @escaping ( ) -> ( ) ) {
307316 if animated {
308317 UIView . animate ( withDuration: 0.15 , animations: {
@@ -319,10 +328,8 @@ final class PaginationView: UIView, Loggable {
319328 fade ( to: 1 , completion: completion)
320329 }
321330 }
322-
323- return true
324331 }
325-
332+
326333 private func scrollToView( at index: Int , location: PageLocation , completion: @escaping ( ) -> Void ) {
327334 guard currentIndex != index else {
328335 if let view = currentView {
You can’t perform that action at this time.
0 commit comments