CarouselView

public class CarouselView : UIView, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout
extension CarouselView: CarouselCollectionViewLayoutDelegate
extension CarouselView: CarouselCollectionViewLayoutDataSource

A view that manages an ordered collection of data items (eg. lenses) and displays them in a swipeable row with one item always selected.

  • The delegate for the carousel view which will be notified of the carousel view actions.

    Declaration

    Swift

    public weak var delegate: CarouselViewDelegate?
  • The object that manages data and provides items for the carousel view.

    Declaration

    Swift

    public weak var dataSource: CarouselViewDataSource? { get set }
  • Reloads all of the data in the carousel view to display the latest carousel items.

    Declaration

    Swift

    public func reloadData()
  • Current selected item or nil if none are selected (ie. when carousel is empty).

    Declaration

    Swift

    public private(set) var selectedItem: CarouselItem { get }

Init

  • Undocumented

    Declaration

    Swift

    public override var intrinsicContentSize: CGSize { get }
  • Undocumented

    Declaration

    Swift

    public override func layoutSubviews()

Items

  • Select carousel item Returns true if item exists in carousel and is selected or false if failed to select item

    Declaration

    Swift

    @discardableResult
    public func selectItem(_ selected: CarouselItem) -> Bool

    Parameters

    selected

    carousel item to select

  • Hide lens carousel. Sets Items to selected item and saves list to show later.

    Declaration

    Swift

    public func hideCarousel()
  • Show lens carousel. Sets Items to previous stored item list and reloads collectionView.

    Declaration

    Swift

    public func showCarousel()

Collection View

  • Undocumented

    Declaration

    Swift

    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
  • Undocumented

    Declaration

    Swift

    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath)
        -> UICollectionViewCell
  • Undocumented

    Declaration

    Swift

    public func collectionView(
        _ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath
    )
  • Undocumented

    Declaration

    Swift

    public func collectionView(
        _ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath
    )
  • Undocumented

    Declaration

    Swift

    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)

Scroll View

  • Undocumented

    Declaration

    Swift

    public func scrollViewDidScroll(_ scrollView: UIScrollView)

Collection View Layout