AlertBanner

open class AlertBanner: NSObject

Use the AlertBanner.manager to display errors. You don’t need to create your own instance.

  • Use the manager singleton to display errors

    Declaration

    Swift

    open static var manager: AlertBanner = AlertBanner()
  • Shows an alert banner dropping from the top of the screen.

    Declaration

    Swift

    open class func show(_ message: String, as level: AlertBannerLevel = .error, file: String = #file, line: Int = #line, onTap:(()->Void)? = nil)

    Parameters

    message

    String message to display in the banner.

    level

    AlertBannerLevel of the alert, defaults to .error.

    file

    Automatically gets file where Alert is being presented, don’t provide this.

    line

    Automatically gets line where Alert is being presented, don’t provide this.

    onTap

    Closure to execute on tapping the banner

  • Shows an alert banner dropping from the top of the screen.

    Declaration

    Swift

    open class func show(_ error: Error, as level: AlertBannerLevel = .error, file: String = #file, line: Int = #line, onTap:(()->Void)? = nil)

    Parameters

    error

    Error to display in the banner, using the localizedErrorMessage property of the error.

    level

    AlertBannerLevel of the alert, defaults to .error.

    file

    Automatically gets file where Alert is being presented, don’t provide this.

    line

    Automatically gets line where Alert is being presented, don’t provide this.

    onTap

    Closure to execute on tapping the banner

  • Hide the error immediately

    Declaration

    Swift

    open class func hide()
  • Show the standard offline error

    Declaration

    Swift

    open class func showOfflineError()
  • Show the standard online error

    Declaration

    Swift

    open class func hideOfflineError()