Apologies
You must be signed in to watch this lesson.
Dynamic Today Cells
AppStore JSON APIs
Today's video we'll go over how to support different today cell items in our TodayController list. This is relatively easy once we set up the correct subviews inside of TodayCell. After those subviews are in place, we simply create a model object that represents each list item. Finally I'll go over how we can feed our AppFullscreenController with the correct today items.
### iOS 13 Updates Due to some Nav Bar changes from iOS 12 to iOS 13, the minimizing animation will appear jumpy with the code presented in the video lesson. I went ahead and updated the sample download zip to include a few tweaks to smooth out the animation. For complete changes, visit the last lesson in the course.

Comments (11)
Tube
5 years ago
How do I get the close button NOT to scroll? Constraints?
fef
5 years ago
hi Brian, lovely cours, I keep a lot of notes about those trick, thx instructor. I wanna ask you a question, about difference between closure and delegate protocol. in which case use Delegate or Closure ? cause I did the dismisHandler instinctively with protocol, but this using of closure remember me the MVVM trick. have a good day.
TWei
5 years ago
Both can make the job done. Closure is bit more light-weight and be careful about retain cycle.
jtamayog
5 years ago
Great course Brian!! I have learned more about swift in these videos than I have at school. I am making an application where I am implementing the layout implemented in this video as the channel feed. I am trying to figure out how to add another cell when a user hits a submit button on another view, essentially creating a cell with custom information that they entered. I have looked online and I am still wondering how to do this. Would it be using the following declaration?? func insertItems(at indexPaths: [IndexPath]) Thanks!
Brian Voong
5 years ago
Ahmed.Q
5 years ago
Hello, I think this is a great course and indeed it is informative, and would it be ok if you explain how to have layout with dynamic cell sizing ? please .
Brian Voong
5 years ago
Anthony hordern
5 years ago
Hey Brian loving the course learning so much. Thanks Heaps !!!
ArtArriaga
5 years ago
Hi, quick question.... what is the difference between [indexPath.row] and [indexPath.item]? How do you determine which to use? :)
Brian Voong
5 years ago
gc
5 years ago
Hi, Brian my dynamic height code does not working ... (height is always 1000) why do this? func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { var height: CGFloat = 0 let arbitraryHeight: CGFloat = 1000 let dummyCell = TodayCell(frame: .init(x: 0, y: 0, width: view.frame.width, height: arbitraryHeight)) let item = items[indexPath.item] dummyCell.todayItem = item dummyCell.layoutIfNeeded() let estimatedSize = dummyCell.systemLayoutSizeFitting(.init(width: view.frame.width, height: arbitraryHeight)) height = estimatedSize.height return .init(width: view.frame.width - 64, height: height) }
romulusc
4 years ago
Hi Brian. I'm going over this course the second time. In the 'Life Hack' cell and 'Holiday' cell, although we change the header dynamically in didSELECT in HomeController at indexPath 0, we return the same attributed text in both cells by returning the same AppFullScreenDescriptionCell. I'm trying to achieve dynamic attributed text as well in 'Life Hack' cell and 'Holiday' cell but there's only one AppFullScreenDescriptionCell. How do I​ approach this if you have a minute to get different descriptions in these 2 different cells?. Many thanks
romer_96p@hotmail.com
4 years ago
Hi Brian, my UIView() for the "imageView" slides all the way to the right and it won't center... please help. I do have all to the "Helpers Files" so am not sure what the issue may be. thanks man
mrchanlee
4 years ago
Hi Brian, do you have any tips for handling smoother animation for description label in TodayController and TodayCell? After dismissing from AppFullscreenController back to TodayController on the second cell you can see the text adjust it's content to fit the frame width. In the first line "Find out all you need to know on how to" you can see the word travel jump from the first line to second line.
Kritbovorn Taweeyossak
4 years ago
Me too, try to fixed this a lot of days, Help me please.
gene8189
3 years ago
Hi there. Anyone encounter an issue with the close button? I cant manage to close the appFullscreenController with the close button even with brian`s project.
Lazaro Ambrosio
3 years ago
This happened to me also. I don't know the reason why.
Lazaro Ambrosio
3 years ago
In the AppFullScrenHeaderCell, you must put contentView.addSubview() Here is the code blow to the problem. That should solve the issue. class AppFullScreenHeaderCell: UITableViewCell { let todayCell = TodayCell() let closeButton: UIButton = { let button = UIButton(type: .system) button.setImage(#imageLiteral(resourceName: "apps"), for: .normal) return button }() override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) contentView.addSubview(todayCell) todayCell.fillSuperview() contentView.addSubview(closeButton) closeButton.anchor(top: topAnchor, leading: nil, bottom: nil, trailing: trailingAnchor, padding: .init(top: 12, left: 0, bottom: 0, right: 12), size: .init(width: 80, height: 38)) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
HELP & SUPPORT