Structures

The following structures are available globally.

  • Struct with required configuration for dialog buttons

    Declaration

    Swift

    public struct DialogButtonConfiguration
  • NatLogoImages is a struct with all logo images from the design system. The Images changes according with the current Brand configured in the Design system and according with user properties of Light and Dark mode.

    This struct has 2 variants:

    • horizontal
    • vertical

    Example of usage:

       let logoHorizontal = NatLogoImages.horizontal
       let logoVertical = NatLogoImages.vertical
    

    Requires

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

       DesignSystem().configure(with: AvailableTheme)
    
    See more

    Declaration

    Swift

    @available(*, deprecated, message: "Use NatLogo component instead")
    public struct NatLogoImages
  • NatColors is a struct that has access to colors from the design system. This colors changes according with the current theme configured in the Design system.

    All properties returns UIColor.

    Color palette is separeted by groups listed bellow, but this class deliveries all colors in flat way without nested objected.

    • Primary: primary, onPrimary, primaryLight, onPrimaryLight, primaryDark, onPrimaryDark
    • Secundary: secondary, onSecondary, secondaryLight, onSecondaryLight, secondaryDark, onSecondaryDark
    • Surface: background, onBackground, surface, onSurface
    • Content: highlight, highEmphasis, mediumEmphasis, lowEmphasis
    • Feedback: success, onSuccess, warning, onWarning, alert, onAlert, link, onLink

    Example of usage:

       let label = UILabel()
       label.backgroundColor = NatColors.primary
       label.textColor = NatColors.onPrimary
    

    Requires

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

       DesignSystem().configure(with: AvailableTheme)
    
    See more

    Declaration

    Swift

    public struct NatColors
  • NatElevation is a struct that has access to elevation attributes properties from the Design System. This properties are used with view.layer to create elevation visual effect. According with the current theme in the Design System this properties can change.

    Example of usage:

       NatElevation.apply(onView: variantCardView, with: elevation09)
    

    Requires

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

       DesignSystem().configure(with: AvailableTheme)
    
    See more

    Declaration

    Swift

    public struct NatElevation
  • NatFonts is a struct that has methods to create fonts from the Design System tokens. According with the current Brand in the Design System this properties can change.

    Example of usage:

       label.font = NatFonts.font(ofSize: .heading6 withWeight: .regular)
    

    Requires

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

       DesignSystem().configure(with: AvailableTheme)
    
    See more

    Declaration

    Swift

    public struct NatFonts