I tried this framework.
Everything works except when I need to pass data from the collection view to another view controller, it gave me fatal error. This error only occurs on devices running below iOS 13.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "ShowPaintingList" {
guard let indexPath = categoryCollectionView.indexPathsForSelectedItems?.first
else { fatalError() } // fatal error here
if let paintingListCollectionViewController = segue.destination as? PaintingListCollectionViewController {
paintingListCollectionViewController.allPaintings = genreSectionData[indexPath.item]
}
}
}
Xcode console does not output any error message so this is kinda difficult to debug.
So I commented out guard let and else { fatalError() }, change indexPath to indexPath!. Now Xcode says indexPath is nil.
I am not sure passing data is supported by this framework, but what is the point of using collection view if it cannot pass data...If anyone had any success please let me know, thanks!
I tried this framework. Everything works except when I need to pass data from the collection view to another view controller, it gave me fatal error. This error only occurs on devices running below iOS 13.
Xcode console does not output any error message so this is kinda difficult to debug. So I commented out
guard let
andelse { fatalError() }
, changeindexPath
toindexPath!
. Now Xcode says indexPath is nil.I am not sure passing data is supported by this framework, but what is the point of using collection view if it cannot pass data...If anyone had any success please let me know, thanks!