FUIWhatsNewDetailListController

open class FUIWhatsNewDetailListController : UIViewController, UICollectionViewDataSource, UICollectionViewDelegate

List style controller to be used in FUIWhatsNewViewController.

Components:

  • collectionView

Usage

 class CollectionViewDataSource: UICollectionViewDataSource {
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 2
    }

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: FUIWhatsNewCollectionViewCell.reuseIdentifier, for: indexPath) as! FUIWhatsNewCollectionViewCell
        switch indexPath.item {
        case 0:
            cell.detailImageViewSize = CGSize(width: 66, height: 66)
            cell.detailImageView.image = UIImage(named: "cat")
            cell.headlineLabel.text = "headline text"
            cell.subheadlineLabel.text = "subheadline text"
        case 1:
            // configure cell
        }

        return cell
    }
 }

 let listController = FUIWhatsNewDetailListController()
 listController.collectionView.dataSource = CollectionViewDataSource()
  • Define the collectionView

    Declaration

    Swift

    public private(set) var collectionView: UICollectionView! { get }