FrameDataSource

@objc(IMGLYFrameDataSource) open class FrameDataSource: NSObject

A frame data source provides the frames that should be displayed in the frame tool.

  • The collection view of this data source.

    Declaration

    Swift

    open let collectionView: UICollectionView
  • The currently used image aspect ratio.

    Declaration

    Swift

    open var ratio = CGFloat(1)
  • The tolerance that is used to pick the correct frame image based on the aspect ratio. Defaults to 0.1.

    Declaration

    Swift

    open var tolerance = CGFloat(0.1)
  • The frames to display.

    Declaration

    Swift

    open var allFrames: [Frame]?
  • Get all frames matching the set ratio and tolerance.

    Declaration

    Swift

    open var matchingFrames: [Frame]?
  • A closure that is called to modify the ‘No Frame’ cell.

    Declaration

    Swift

    open var noFrameCellConfigurationClosure: ((IconCaptionCollectionViewCell) -> Void)?
  • A closure that is called to modify the cell for a given frame.

    Declaration

    Swift

    open var frameCellConfigurationClosure: ((IconBorderedCollectionViewCell, Frame) -> Void)?
  • Creates a new frame data source for the given collection view.

    Declaration

    Swift

    public init(collectionView: UICollectionView)

    Parameters

    collectionView

    The collection view of this data source.