BaseUICollectionViewCell

open class BaseUICollectionViewCell: UICollectionViewCell, UIViewControllerPreviewingDelegate, BaseView

BaseUICollectionViewCell is a subclass of UICollectionViewCell and implements BaseView and UIViewControllerPreviewingDelegate. This class should be used for the collection view cells throughout the project.

  • Holds data of the Collection View Cell.

    Declaration

    Swift

    open var data:Any?
  • Overridden method to setup/ initialize components.

    Declaration

    Swift

    override open func awakeFromNib()
  • This method should be called in cellForRowAt:indexPath. it also must be overriden in all sub classes of BaseUICollectionViewCell to update the collection view cell’s content.

    Parameter

    Parameter data: Cell Data

    Declaration

    Swift

    open func updateData(_ data:Any?)

    Parameters

    data

    Cell Data

  • Protocol method for viewControllerForLocation (CGPoint)

  • Parameters:

    • previewingContext: UIViewControllerPreviewing
    • location: Location for view controller
  • Returns

    returns view controller for location - nil by default

    Declaration

    Swift

    open func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController?

    Parameters

    previewingContext

    UIViewControllerPreviewing

    location

    Location for view controller

    Return Value

    returns view controller for location - nil by default

  • Protocol method for viewControllerToCommit

    • Parameters:
      • previewingContext: UIViewControllerPreviewing
      • viewControllerToCommit: ViewController to commit

    Declaration

    Swift

    open func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController)

    Parameters

    previewingContext

    UIViewControllerPreviewing

    viewControllerToCommit

    ViewController to commit