BannerViewProtocol

public protocol BannerViewProtocol : UIView

A banner view protocol to show realtime updates.

  • Undocumented

    Declaration

    Swift

    typealias Completion = (_ view: BannerView) -> Void
  • Undocumented

    Declaration

    Swift

    var textLabel: UILabel { get }
  • Present the banner view in a view controller.

    Declaration

    Swift

    @discardableResult
    func show(_ text: String, in viewController: UIViewController) -> Self

    Parameters

    viewController

    a view controller where needs to present the banner.

  • Hide the banner.

    Declaration

    Swift

    func hide()
  • Hide the banner after a given time interval.

    Declaration

    Swift

    func hide(after timeInterval: DispatchTimeInterval, _ completion: Completion?)

    Parameters

    timeInterval

    an interval of the time after the banner will hide if needed.

    completion

    a block will call when the timer will be triggered to hide the banner.

  • Add a tap action to the banner.

    Declaration

    Swift

    func addTap(_ action: @escaping Completion)
  • Remove the tap action from the banner.

    Declaration

    Swift

    func removeTap()