You'll often want to respond in some way when a collection view cell is selected. Maybe you'll zoom in on a photo or present some other type of data to your user. See how to respond to cell selections in this video.
- [Narrator] Now let's look at responding…when you select an item in the collectionView.…So what I'm going to do is scroll up here…to this navigation section and uncomment it.…Just like with the tableView…that we looked at in the previous course in this series,…we have the prepare for segue method.…We actually transition to another view in the same way.…So what we do is we listen for…the didSelectItemAt indexPath method.…
When that happens, we call performSegue.…Before the segue is performed, this method is called.…So what we need to do first is go back into our storyboard,…and in there, we're going to create a segue…between each of the view controllers.…So I'm going to scroll in between the two view controllers,…click in the bar for collection view controller,…then right-click and drag…from my collection view controller object…right into the view of the view controller.…
This creates a segue.…Then I'm asked to choose which type of segue…I want to create.…I'll hit the show segue.…Click on the segue that's created,…
- Advanced UI controls
- Creating alert controllers
- Displaying web content
- Creating a collection view controller
- Creating a custom data type
- Creating tabbed apps
- Importing and setting icons for your apps
- Publishing your app to the App Store
Skill Level Beginner
iOS and watchOS App Development: Notificationswith Steven Lipton3h 45m Intermediate
1. Mastering Views
2. Display Web Content
3. Collection Views
4. Multi-View Templates
5. Publish an App
Next steps1m 21s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.