FUISimpleCollectionViewCell

open class FUISimpleCollectionViewCell: NibDesignableCollectionViewCell

FUISimpleCollectionViewCell is a variant of UICollectionViewCell defined in SAPFiori. It contains a UIImageView and a UILabel.

Code usage:

Implement collectionView(_:cellForItemAt:) dataSource method


 //Implement collectionView(_:cellForItemAt:) dataSource method
 func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
     let cell = collectionView.dequeueReusableCell(withReuseIdentifier: FUISimpleCollectionViewCell.reuseIdentifier, for: indexPath) as! FUISimpleCollectionViewCell

     //configure cell
     cell.contentImage = UIImage()
     cell.titleText = "Title"

     return cell
 }

Create and assign a layout object to collection view


 let layout = UICollectionViewFlowLayout()

 // Set any custom layout here.
 layout.itemSize = CGSize(width: 126, height: 126)
 layout.minimumInteritemSpacing = 10
 layout.minimumLineSpacing = 10

 // Sets the flow layout to CollectionView
 collectionView.collectionViewLayout = layout
 collectionView.dataSource = self
 collectionView.register(FUISimpleCollectionViewCell.self, forCellWithReuseIdentifier: FUISimpleCollectionViewCell.reuseIdentifier)

  • Reuse identifier

    Declaration

    Swift

    open static var reuseIdentifier: String
  • Image view of FUISimpleCollectionViewCell.

    Declaration

    Swift

    @IBOutlet open var contentImageView: UIImageView!
  • Label of FUISimpleCollectionViewCell.

    Declaration

    Swift

    @IBOutlet open var titleLabel: UILabel!
  • Image of FUISimpleCollectionViewCell

    Declaration

    Swift

    open var contentImage: UIImage?
  • Title of FUISimpleCollectionViewCell

    Declaration

    Swift

    open var titleText: String?