-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
844260e
commit adfa765
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
I changed to use ContiguousArray< UIViewController > type to store UIViewControllers in a contiguous block of memory. | ||
|
||
When using a large number of UIViewControllers as tabs, I think that using ContiguousArray will yield more predictable performance compared to Array. | ||
|
||
|
||
|
||
The changed files are: | ||
|
||
- Sources/PagerTabStripViewController.swift | ||
|
||
for Example: | ||
|
||
- BarExampleViewController.swift | ||
- ButtonBarExampleViewController.swift | ||
- InstagramExampleViewController.swift | ||
- NavButtonBarExampleViewController.swift | ||
- SegmentedExampleViewController.swift | ||
- SpotifyExampleViewController.swift | ||
- TwitterExampleViewController.swift | ||
- YoutubeExampleViewController.swift | ||
- YoutubeWithLabelExampleViewController.swift | ||
|
||
|
||
|
||
References | ||
|
||
- https://github.com/apple/swift/blob/main/docs/Arrays.rst | ||
|
||
- https://developer.apple.com/documentation/swift/contiguousarray | ||
|
||
- https://github.com/apple/swift/blob/main/docs/OptimizationTips.rst#advice-use-contiguousarray-with-reference-types-when-nsarray-bridging-is-unnecessary | ||
|
||
- http://jordansmith.io/on-performant-arrays-in-swift/ | ||
- https://medium.com/@nitingeorge_39047/swift-array-vs-contiguousarray-a6153098a5 |