I have a ready-made collection, and I'm trying to do didSelectItemAt to go to the detailed view. But I just want to check the registration of each of the elements and not register.
I already installed all the delegates:
*
class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UISearchBarDelegate {* @IBOutlet weak var activityIndicatorView: UIActivityIndicatorView! @IBOutlet weak var searchBar: UISearchBar! @IBOutlet weak var collection: UICollectionView! override func viewDidLoad() { super.viewDidLoad() collection.dataSource = self collection.delegate = self searchBar.delegate = self activityIndicatorView.isHidden = true let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "dismissKeyboard") view.addGestureRecognizer(tap) }
*
What am I doing wrong?
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let movie : Movie movie = MOVIE_ARRAY[indexPath.row] print(movie.plot) }

source share