Skip to content

Commit 534babf

Browse files
authored
Fix example app: avoid preload viewDidLoad (#142)
Avoid access `collectionView` in `init` (`SimpleFlowLayoutViewController`), which will call `viewDidLoad` immediatly.
1 parent 20ef18c commit 534babf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Example/Sources/FlowLayout/SimpleFlowLayoutViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ final class SimpleFlowLayoutViewController: UICollectionViewController, UICollec
2424
init() {
2525
let layout = UICollectionViewFlowLayout()
2626
super.init(collectionViewLayout: layout)
27-
self.collectionView.alwaysBounceVertical = true
2827
}
2928

3029
@available(*, unavailable)
@@ -36,6 +35,7 @@ final class SimpleFlowLayoutViewController: UICollectionViewController, UICollec
3635

3736
override func viewDidLoad() {
3837
super.viewDidLoad()
38+
self.collectionView.alwaysBounceVertical = true
3939
self.collectionView.accessibilityIdentifier = "Flow Layout"
4040

4141
self.driver.flowLayoutDelegate = self

0 commit comments

Comments
 (0)