Skip to content

Offline Banner Message View

FUIOfflineBannerMessageView

public class FUIOfflineBannerMessageView: FUIBannerMessageView

FUIOfflineBannerMessageView shows an overlay message centered in the screen underneath a navigation bar. FUIOfflineBannerMessageView must be attached to a FUINavigationBar to make it work properly. FUIOfflineBannerMessageView is a subclass of FUIBannerMessageView and FUINavigationBar can contain only one FUIBannerMessageView.

Call show() on a FUIOfflineBannerMessageView instance to show the message. By default, the message is shown centered on screen for four seconds.

Usage

Usually, the creation of FUIOfflineBannerMessageView and attachment to FUINavigationBar is in the viewDidAppear function of a UIViewController. As the code indicates below:

override public func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    guard let navBar = self.navigationController?.navigationBar as? FUINavigationBar else {
        return
    }

    let offlineBannerView = FUIOfflineBannerMessageView()
    navBar.bannerView = offlineBannerView
    offlineBannerView.show(message: "200k pending to upload example with text showing wrapping to two lines")
    self.offlineBanner = offlineBannerView
}

Theming

fdlFUIOfflineBannerMessageView_titleLabel {
font-size: 13;
font-name: mediumSystem;
font-color: @primary7;
font-color-highlighted: @tintColorDark;
}

fdlFUIOfflineBannerMessageView_dividerBottom {
background-color: @line;
}

Last update: December 8, 2020