Skip to content

Instantly share code, notes, and snippets.

@karigrooms
Last active February 24, 2021 00:45
Show Gist options
  • Save karigrooms/4c221bebb89b293e545c3f4dc80055f3 to your computer and use it in GitHub Desktop.
Save karigrooms/4c221bebb89b293e545c3f4dc80055f3 to your computer and use it in GitHub Desktop.
Blog post: SwiftUI with UICollectionView - 16. Present the property details when a property card is tapped
// MARK: UICollectionViewDelegate
extension CollectionViewExample: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let item = items[indexPath.row]
let pdp = PropertyDetailsViewController(property: item)
pdp.modalPresentationStyle = .formSheet
present(pdp, animated: true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment