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
messageString message to display in the banner.
levelAlertBannerLevelof the alert, defaults to .error.fileAutomatically gets file where Alert is being presented, don’t provide this.
lineAutomatically gets line where Alert is being presented, don’t provide this.
onTapClosure 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
errorError to display in the banner, using the
localizedErrorMessageproperty of the error.levelAlertBannerLevelof the alert, defaults to .error.fileAutomatically gets file where Alert is being presented, don’t provide this.
lineAutomatically gets line where Alert is being presented, don’t provide this.
onTapClosure 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()
AlertBanner Class Reference