@@ -62,7 +62,7 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate
62
62
public weak var delegate : PagerTabStripViewControllerDelegate ?
63
63
public weak var datasource : PagerTabStripViewControllerDataSource ?
64
64
65
- public var pagerOptions = PagerTabStripOptions . SkipIntermediateViewControllers . union ( . IsProgressiveIndicator ) . union ( . IsElasticIndicatorLimit )
65
+ public var pagerBehaviour = PagerTabStripBehaviour . Progressive ( skipIntermediteViewControllers : true , elasticIndicatorLimit : true )
66
66
67
67
public private( set) var viewControllers = [ UIViewController] ( )
68
68
public private( set) var currentIndex = 0
@@ -131,7 +131,7 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate
131
131
currentIndex = index
132
132
return
133
133
}
134
- if animated && pagerOptions . contains ( . SkipIntermediateViewControllers ) && abs ( currentIndex - index) > 1 {
134
+ if animated && pagerBehaviour . skipIntermediateViewControllers && abs ( currentIndex - index) > 1 {
135
135
var tmpViewControllers = viewControllers
136
136
let currentChildVC = viewControllers [ currentIndex]
137
137
let fromIndex = currentIndex < index ? index - 1 : index + 1
@@ -253,7 +253,7 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate
253
253
currentIndex = newCurrentIndex
254
254
let changeCurrentIndex = newCurrentIndex != oldCurrentIndex
255
255
256
- if let progressiveDeledate = self as? PagerTabStripViewControllerIsProgressiveDelegate where pagerOptions . contains ( . IsProgressiveIndicator ) {
256
+ if let progressiveDeledate = self as? PagerTabStripViewControllerIsProgressiveDelegate where pagerBehaviour . isProgressiveIndicator {
257
257
258
258
let ( fromIndex, toIndex, scrollPercentage) = progressiveIndicatorData ( virtualPage)
259
259
try ! progressiveDeledate. pagerTabStripViewController ( self , updateIndicatorFromIndex: fromIndex, toIndex: toIndex, withProgressPercentage: scrollPercentage, indexWasChanged: changeCurrentIndex)
@@ -355,7 +355,7 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate
355
355
}
356
356
}
357
357
}
358
- let scrollPercentage = pagerOptions . contains ( . IsElasticIndicatorLimit ) ? self . scrollPercentage : ( ( toIndex < 0 || toIndex >= count) ? 0.0 : self . scrollPercentage)
358
+ let scrollPercentage = pagerBehaviour . isElasticIndicatorLimit ? self . scrollPercentage : ( ( toIndex < 0 || toIndex >= count) ? 0.0 : self . scrollPercentage)
359
359
return ( fromIndex, toIndex, scrollPercentage)
360
360
}
361
361
0 commit comments