FUIEmptyStateView

@available(*, deprecated, message: "This component has been replaced by FUIIllustratedMessage")
@MainActor
public class FUIEmptyStateView : FUIBaseDrawingView, FUITitleMultiLineComponent, FUIBodyMultiLineComponent, FUIDetailImageViewComponent, FUIPrimaryActionComponent

FUIEmptyStateView: conforms to the UIView class and contains SwiftUI component EmptyStateView as a container.

Usage 1: simple

  let emptyView = FUIEmptyStateView()
  emptyView.title.text = "Custom placeholder title"
  emptyView.body.text = "This is a text to describe what you can do when there is no data"
  emptyView.detailImageView.image = UIImage(named: "errorMessage")
  let actionButton = FUIButton()
  // ... configure button style
  // actionButton.setContentHuggingPriority(.defaultHigh, for: .horizontal)
  // actionButton.setContentHuggingPriority(.defaultHigh, for: .vertical)
  emptyStateView.primaryAction = actionButton

Usage 2: customization

  let emptyStateView = FUIEmptyStateView()

  emptyStateView.title.text = ...
  emptyStateView.titleAttributedText = ...

  emptyStateView.body.text = ...
  emptyStateView.bodyAttributedText = ...

  let detailImageView = FUIImageView()
  // ... configure imageView style
  emptyStateView.detailImageView = detailImageView

  let actionButton = FUIButton()
  // ... configure button style
  // actionButton.setContentHuggingPriority(.defaultHigh, for: .horizontal)
  // actionButton.setContentHuggingPriority(.defaultHigh, for: .vertical)
  emptyStateView.primaryAction = actionButton
  • Method invoked when frames are recalculated

    Declaration

    Swift

    @MainActor
    public override func calculateLayout(_ targetSize: CGSize)

    Parameters

    targetSize

    CGSize of the target to be recalculated