FUILoadingIndicatorView

open class FUILoadingIndicatorView : NibDesignable

FUILoadingIndicatorView is an IBdesignable UI component. A loading indicator shows that something is currently in progress. It shows a UIActivityIndicatorView to visualize progress and a UILabel indicating to the user what is in progress.

By default, this view is visible and the animation is stopped. To start the animation call `startAnimating()`.

## Initialization ### Programmatically:

 let loadingIndicatorView = FUILoadingIndicatorView(frame: CGRect())

### Inside a Storyboard or xib:

  1. Drag and drop an UIView component to Interface Builder canvas.
  2. Switch class name from UIView to FUILoadingIndicatorView, and set module to SAPFiori.
  3. Create an outlet of the loading indicator to be able to access its properties.

## Usage

 loadingIndicatorView.show()
 // do something
 loadingIndicatorView.dismiss()

## Animation The animation of the activity indicator can be started or stopped without affecting the visibility of the view.

 loadingIndicatorView.startAnimating()
 // do something
 loadingIndicatorView.stopAnimating()

## Theming

The styleClass of the view is fdlFUILoadingIndicatorView.

In the .nss file you can use the following parameters:

  • fdlFUILoadingIndicatorView_textLabel: changes the appearance of the textLabel

### Example:

fdlFUILoadingIndicatorView_textLabel {
     background-color: red;
     border-color: green;
     border-width: 2;
     corner-radius: 2;
     font-color: blue;
     font-color-highlighted: yellow;
     font-name: Avenir;
     font-size: 15;
     height: 50;
     shadow-color: black;
     shadow-offset: 1, 2;
     shadow-opacity: 0.5;
     shadow-radius: 2;
     text-align: center;
     text-alpha: 0.9;
     text-auto-fit: true;
     text-shadow-color: black;
     text-shadow-offset: 1, 2;
     text-transform: uppercase;
     text-line-clamp:6;
     width: 100;
 }
  • fdlFUILoadingIndicatorView_activityIndicator: changes the appearance of activityIndicator

### Example:

 fdlFUILoadingIndicatorView_activityIndicator {
    color: blue;
 }
  • Activity indicator that is either spinning or stopped.

    Declaration

    Swift

    @IBOutlet
    weak public private(set) var activityIndicator: UIActivityIndicatorView! { get }
  • Text label below the activity indicator.

    Declaration

    Swift

    @IBOutlet
    weak public private(set) var textLabel: UILabel! { get }
  • Text of textLabel. The default is a localized version of LOADING.

    Declaration

    Swift

    @IBInspectable
    public var text: String? { get set }
  • A boolean value that indicates whether the activity indicator is currently spinning.

    Declaration

    Swift

    public var isAnimating: Bool { get }
  • Shows the loading indicator and starts spinning the activity indicator.

    Declaration

    Swift

    open func show(animated: Bool = true)

    Parameters

    animated

    whether the loading indicator is shown with a fade animation.

  • Dismisses the loading indicator and stops spinning the activity indicator.

    Declaration

    Swift

    open func dismiss()
  • Starts the spinning animation of the activity indicator until it is stopped.

    Declaration

    Swift

    open func startAnimating()
  • Stops the spinning animation of the activity indicator.

    Declaration

    Swift

    open func stopAnimating()