Skip to content

Commit 2d5d673

Browse files
Replace Array<ViewController> with Contiguous Array<UIViewController>
Replace those declared as Array<ViewController> with Contiguous Array<UIViewController> type that is stored in contiguous blocks of memory.
2 parents bd0af43 + ba7ebd7 commit 2d5d673

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/PagerTabStripViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public protocol PagerTabStripIsProgressiveDelegate: PagerTabStripDelegate {
4444

4545
public protocol PagerTabStripDataSource: class {
4646

47-
func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController]
47+
func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> ContiguousArray<UIViewController>
4848
}
4949

5050
// MARK: PagerTabStripViewController
@@ -58,7 +58,7 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
5858

5959
open var pagerBehaviour = PagerTabStripBehaviour.progressive(skipIntermediateViewControllers: true, elasticIndicatorLimit: true)
6060

61-
open private(set) var viewControllers = [UIViewController]()
61+
open private(set) var viewControllers = ContiguousArray<UIViewController>()
6262
open private(set) var currentIndex = 0
6363
open private(set) var preCurrentIndex = 0 // used *only* to store the index to which move when the pager becomes visible
6464

@@ -177,7 +177,7 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
177177

178178
// MARK: - PagerTabStripDataSource
179179

180-
open func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
180+
open func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> ContiguousArray<UIViewController> {
181181
assertionFailure("Sub-class must implement the PagerTabStripDataSource viewControllers(for:) method")
182182
return []
183183
}
@@ -385,7 +385,7 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
385385

386386
}
387387

388-
private var pagerTabStripChildViewControllersForScrolling: [UIViewController]?
388+
private var pagerTabStripChildViewControllersForScrolling: ContiguousArray<UIViewController>?
389389
private var lastPageNumber = 0
390390
private var lastContentOffset: CGFloat = 0.0
391391
private var pageBeforeRotate = 0

0 commit comments

Comments
 (0)