To populate collection view cells, we need some data. In this video, see how to put simple data into collection view cells, and all of the steps that are included with that process.
- [Tutor] Now that we have our custom collectionViewCells,…let's actually put them…inside of the collectionViewController,…using some code.…So I'm going to go to the standard editor,…and head over to collectionViewController.swift.…And in here, I'm going to scroll down,…to number of sections.…I'll hide the right area for some more space.…And in number of sections in collectionView,…you're going to see this warning.…That it's an incomplete implementaion,…let's delete that.…
Since we're fixing that right now.…Return one, so we'll have,…one section in the collectionView.…And then we have, collectionView, numberOfItemsInSection.…Let's delete this comment as well,…and change the number to 20.…Now if we were to run the application,…we would get 20 cells on the screen.…For now I'm not going to run it though,…I'm going to scroll down into collectionView,…cell for item at indexPath.…
So, in here, we have a cell created,…based on reuseIdentifier.…Which is supplied at the top,…so it's in a constant value right here,…it's lower case "cell" which we set earlier…
- Alert controllers and actions
- Sliders, progress bars, and switches
- Creating UI elements with code
- Displaying web content with Safari view controllers and WKWebView
- Creating collection view controllers
- Creating tabbed apps
- Publishing your app with App Store Connect
Skill Level Beginner
1. Master Views
2. Display Web Content
3. Collection Views
4. Multiview Templates
Customize a table view cell4m 18s
5. Publish an App
Next steps3m 28s
- 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.