file in memory, ready for unarchiving and instantiation. When your application needs to instantiate the contents of the nib file it can do so without having to load the data from the nib file first, improving performance. The UINib object can automatically release this cached nib data to free up memory for your application under low-memory conditions, reloading that data the next time your application instantiates the nib.
enum Item: Hashable { case thumbnail case summary case contentInfo case other case recommend(IndexPath) } } extension SectionModel: AnimatableSectionModelType { var identity: AnyHashable { AnyHashable(self) } var items: [Item] { switch self { case let .content(items), let .recommend(items): return items } } init(original: SectionModel, items: [Item]) { switch original { case .content: self = .content(items) case .recommend: self = .recommend(items) } } } extension SectionModel.Item: IdentifiableType { var identity: AnyHashable { AnyHashable(self) } }
Hashable { case thumbnail case summary case contentInfo case other case episodeList case recommend(IndexPath) case recommendList(IndexPath) } } final class DetailViewController: UIViewController { ... private lazy var configureCell: DataSource.ConfigureCell = { [weak self] _, collectionView, indexPath, item in ... switch item { ... case let .recommend(indexPath): let cell = collectionView.dequeueReusableCell(RecommendCell.self, for: indexPath) cell.setEpisode(me.viewModel.recommendList.value[indexPath.row]) return cell case let .recommendList(indexPath): let cell = collectionView.dequeueReusableCell(RecommendListCell.self, for: indexPath) cell.setEpisode(me.viewModel.recommendList.value[indexPath.row]) return cell } } }
Hashable { case thumbnail case summary case contentInfo case other case episodeList case recommend(IndexPath) case recommendList(IndexPath) } } final class DetailViewController: UIViewController { ... private lazy var configureCell: DataSource.ConfigureCell = { [weak self] _, collectionView, indexPath, item in ... switch item { ... case let .recommend(indexPath): let cell = collectionView.dequeueReusableCell(RecommendCell.self, for: indexPath) cell.setEpisode(me.viewModel.recommendList.value[indexPath.row]) return cell case let .recommendList(indexPath): let cell = collectionView.dequeueReusableCell(RecommendListCell.self, for: indexPath) cell.setEpisode(me.viewModel.recommendList.value[indexPath.row]) return cell } } } wABςετͷରͱͳΔཁૉͱ࣮ͷՃ