UIView

extension UIView

Extension on UIView to add view tracking related methods

  • Starts view tracking on the view instance

    This method needs to be called to track the viewability of any particular view instance.

    Important

    This method also needs to be called on the parent UIViewController’s view

    Important

    This method also needs to be called on any parent UIScrollView instance

    Important

    This method also needs to be called on any parent recyclable view like UITableViewCell or UICollectionViewCell

    Declaration

    Swift

    public func trackView(_ listener: ViewabilityListener? = nil, conditions: [ViewCondition] = [])

    Parameters

    listener

    The listener for change in viewability state of the view

    conditions

    Additional viewability conditions attached to the view