NatDialogController

public final class NatDialogController : UIViewController

Note

This component is available in the following variants:
  • ✅ Standard
  • ✅ Alert

With the following attributes:

  • ✅ Divider
  • ✅ Size/width
  • ✅ Size/height
  • ❌ Scroll
  • ❌ Header’s icon buttons

NatDialogController is a class that represents a component from the design system. Its colors change according to the current brand theme.

To create and configure the dialog it’s necessary to use Dialog Builders, which are available as class properties.

Available styles for the dialog:

  • Standard
  • Alert

Configurable elements for the dialog:

  • Title
  • Body (Text or custom view)
  • Primary button (must be configured before other buttons)
  • Secondary button
  • Divider

Example of usage:

         let dialog = NatDialogController
         .standardStyleBuilder
         .configure(title: "Title")
         .configure(body: "Body")
         .configure(divider: true)
         .configure(primaryTitle: "Title", primaryAction: { print("Some text") })
         .build()

Requires

It’s necessary to configure the Design System with a theme or fatalError will be raised.

    DesignSystem().configure(with: AvailableTheme)

Class properties

  • Class property to access StandardStyleBuilder.

    Available elements to configure:

    • Title
    • Body (Text or Custom view)
    • Primary Button (must be configured before other buttons)
    • Secondary Button (Optional)
    • Divider

      Example of usage:

      let dialog = NatDialogController .standardStyleBuilder .configure(title: “Title”) .configure(body: “Body”) .configure(primaryTitle: “Title”, primaryAction: { print(“lol”) }) .build()

      Requires

      It’s necessary to configure the Design System with a theme or fatalError will be raised.

      DesignSystem().configure(with: AvailableTheme)

    Declaration

    Swift

    public static var standardStyleBuilder: StandardStyleBuilder { get }
  • Class property to access AlertStyleBuilder.

    Available elements to configure:

    • Title
    • Body
    • Primary Button (must be configured before other buttons)
    • Secondary Button (Optional)

      Example of usage:

      let dialog = NatDialogController .alertStyleBuilder .configure(body: “Body”) .configure(primaryTitle: “Title”, primaryAction: { print(“some text”) }) .build()

      Requires

      It’s necessary to configure the Design System with a theme or fatalError will be raised.

      DesignSystem().configure(with: AvailableTheme)

    Declaration

    Swift

    public static var alertStyleBuilder: AlertStyleBuilder { get }