Skip to content

Instantly share code, notes, and snippets.

@aryasurya21
Created August 4, 2022 07:05
Show Gist options
  • Save aryasurya21/b3b175aa63ef5fdb08d9977c6a07b8f8 to your computer and use it in GitHub Desktop.
Save aryasurya21/b3b175aa63ef5fdb08d9977c6a07b8f8 to your computer and use it in GitHub Desktop.
extension CatalogPageViewController: UICollectionViewDelegate {
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
switch viewModel.data[indexPath.row] {
case let data as Product:
Router.route(.productDetailPage(productID: data))
default:
fatalError("can't read the data")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment