Multiple Cell Type Enumeration
AppStore JSON APIs
In this last section of the course, we'll be implementing the last detail of our TodayController list by implementing a second type of cell. To do this, we'll go through the standard process of creating a new cell class and then registering it on our UICollectionView. After we're able to render it using some hard coded values, we'll move onto support a more dynamic list by utilizing enumerations in our TodayItem class. Enjoy.

Comments (6)
TWei
4 years ago
Just found this episode uploaded. :)
TWei
4 years ago
Brian, you need to be faster. I'm catching up. xD
serxhio
4 years ago
Hey Brian, I'm still in "Fetching Data" section, any chance we're getting a Pagination implementation? I'm kinda hoping for it, nevertheless, this course is just GREAT!
Brian Voong
4 years ago
serxhio
4 years ago
Thank you!
richardbranson
4 years ago
I'm also hoping for Pagination Implementation.
ZiadHamdieh
4 years ago
Could you explain why you declare var todayItem: TodayItem! with a bang instead of the usual "?" ?
Maciek Górecki
4 years ago
Because in this case that doesn't make any difference. You put an optional were there might be nil. Here we have a hardcoded array of non optional TodayItems.
Hadouryu
4 years ago
Hello Brian, first of all another great video. I have one question tho. Its not clear to me why didnt you use init methods when you made BaseTodayCell class because usually we need to set init methods with frame when we are creating UICollectionViewCell. Thanks in advance and have a nice day :)
Hadouryu
4 years ago
Or maybe its not necessary because we have those methods in other cells we that are inheriting from BaseTodayCell, but i guess its better to put those methods inside BaseTodayCell right?
Brian Voong
4 years ago
Hadouryu
4 years ago
I understand, thx a lot mate
李承諴
3 years ago
hi brian why you down cast the type cell to "BaseTodayCell" but it still invoke the didSet in sub class "TodayCell" and "MultipleCell"
Alex Vorojbit
2 years ago
Hey Brian! Amazing tutorial! But why have you hardcoded items[...]? I think all are using JSON instead of hardcoded arrays. How can these be fetched from a JSON, because I'm stuck when changing "collectionView.register(MyCell.self, forCellWithReuseIdentifier: MyCell.identifier)". Also I'm using UICollectionViewDiffableDataSource and NSDiffableDataSourceSnapshot. How could I access cellType ".single" and ".multiple" from JSON? Thank you!
HELP & SUPPORT