mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-17 18:53:40 +01:00
Fixes crash on launch on iOS 13
This commit is contained in:
@@ -55,8 +55,6 @@ class NewsViewController: UICollectionViewController
|
|||||||
self.prototypeCell.translatesAutoresizingMaskIntoConstraints = false
|
self.prototypeCell.translatesAutoresizingMaskIntoConstraints = false
|
||||||
self.prototypeCell.contentView.translatesAutoresizingMaskIntoConstraints = false
|
self.prototypeCell.contentView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
|
||||||
self.collectionView.contentInset.bottom = 20
|
|
||||||
|
|
||||||
self.collectionView.dataSource = self.dataSource
|
self.collectionView.dataSource = self.dataSource
|
||||||
self.collectionView.prefetchDataSource = self.dataSource
|
self.collectionView.prefetchDataSource = self.dataSource
|
||||||
|
|
||||||
@@ -74,6 +72,18 @@ class NewsViewController: UICollectionViewController
|
|||||||
|
|
||||||
self.fetchSource()
|
self.fetchSource()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func viewWillLayoutSubviews()
|
||||||
|
{
|
||||||
|
super.viewWillLayoutSubviews()
|
||||||
|
|
||||||
|
if self.collectionView.contentInset.bottom != 20
|
||||||
|
{
|
||||||
|
// Triggers collection view update in iOS 13, which crashes if we do it in viewDidLoad()
|
||||||
|
// since the database might not be loaded yet.
|
||||||
|
self.collectionView.contentInset.bottom = 20
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension NewsViewController
|
private extension NewsViewController
|
||||||
|
|||||||
Reference in New Issue
Block a user