Skip to content

NfcTutorialConfigurationBuilder

Builder class that helps creation of NfcTutorialConfiguration.

Public Methods

public init(defaultLanguage: String?)

Creates a configuration given the selected language, in string format.

  • Parameters:

    • defaultLanguage: language to be used in the configuration.
public init(defaultLanguage: NfcConfiguration.Language)

Creates a configuration given the selected language, in NfcConfiguration.Language format.

  • Parameters:

    • defaultLanguage: language to be used in the configuration.
@discardableResult
public func setBackgroundColor(_ color: UIColor?) -> NfcTutorialConfigurationBuilder

Sets the background color from desired UIColor.

  • Parameters:

    • color: color for the background.
  • Returns:

    • Builder itself.
@discardableResult
public func setBackgroundColor(_ color: [String : String]?) -> NfcTutorialConfigurationBuilder

Sets the background color from desired dictionary.

The dictionary must contain the following keys:

- "red": red channel, [0, 255].
- "green": green channel, [0, 255].
- "blue": blue channel, [0, 255].
- "alpha": alpha channel, [0, 1].
  • Parameters:

    • color: color for the background.
  • Returns:

    • Builder itself.
@discardableResult
public func setTitleText(_ text: String?) -> NfcTutorialConfigurationBuilder

Sets the title text of the alert.

  • Parameters:

    • text: text of the title.
  • Returns:

    • Builder itself.
@discardableResult
public func setTitleTextColor(_ color: UIColor?) -> NfcTutorialConfigurationBuilder
  • Parameters:

    • color: color for the title text.
  • Returns:

    • Builder itself.
@discardableResult
public func setTitleTextColor(_ color: [String : String]?) -> NfcTutorialConfigurationBuilder

Sets the title text color from desired dictionary.

The dictionary must contain the following keys:

- "red": red channel, [0, 255].
- "green": green channel, [0, 255].
- "blue": blue channel, [0, 255].
- "alpha": alpha channel, [0, 1].
  • Parameters:

    • color: color for the title text.
  • Returns:

    • Builder itself.
@discardableResult
public func setScanButtonTitleText(_ text: String?) -> NfcTutorialConfigurationBuilder

Sets the scan button title text.

  • Parameters:

    • text: text of scan button title.
  • Returns:

    • Builder itself.
@discardableResult
public func setScanButtonTitleTextColor(_ color: UIColor?) -> NfcTutorialConfigurationBuilder

Sets the scan button title text color from desired UIColor.

  • Parameters:

    • color: color for the scan button title text.
  • Returns:

    • Builder itself.
@discardableResult
public func setScanButtonTitleTextColor(_ color: [String : String]?) -> NfcTutorialConfigurationBuilder

Sets the scan button title text color from desired dictionary.

The dictionary must contain the following keys:

- "red": red channel, [0, 255].
- "green": green channel, [0, 255].
- "blue": blue channel, [0, 255].
- "alpha": alpha channel, [0, 1].
  • Parameters:

    • color: color for the scan button title text.
  • Returns:

    • Builder itself.
@discardableResult
public func setScanButtonBackgroundColor(_ color: UIColor?) -> NfcTutorialConfigurationBuilder

Sets the scan button background color from desired UIColor.

  • Parameters:

    • color: color for the scan button background color.
  • Returns:

    • Builder itself.
@discardableResult
public func setScanButtonBackgroundColor(_ color: [String : String]?) -> NfcTutorialConfigurationBuilder

Sets the scan button background color from desired dictionary.

The dictionary must contain the following keys:

- "red": red channel, [0, 255].
- "green": green channel, [0, 255].
- "blue": blue channel, [0, 255].
- "alpha": alpha channel, [0, 1].
  • Parameters:

    • color: color for the scan button background.
  • Returns:

    • Builder itself.
@discardableResult
public func setInformativeText(_ text: String?) -> NfcTutorialConfigurationBuilder

Sets the informative text.

  • Parameters:

    • text: text of the informative text.
  • Returns:

    • Builder itself.
@discardableResult
public func setInformativeTextColor(_ color: UIColor?) -> NfcTutorialConfigurationBuilder

Sets the informative text color from desired UIColor.

  • Parameters:

    • color: color for the informative title text.
  • Returns:

    • Builder itself.
@discardableResult
public func setInformativeTextColor(_ color: [String : String]?) -> NfcTutorialConfigurationBuilder

Sets the informative text color from desired dictionary.

The dictionary must contain the following keys:

- "red": red channel, [0, 255].
- "green": green channel, [0, 255].
- "blue": blue channel, [0, 255].
- "alpha": alpha channel, [0, 1].
  • Parameters:

    • color: color for the informative text.
  • Returns:

    • Builder itself.
@discardableResult
public func setFontName(_ name: String?) -> NfcTutorialConfigurationBuilder

Sets the font name of the font used in all texts.

  • Parameters:

    • name: name of the font to be used in all texts.
  • Returns:

    • Builder itself.
@discardableResult
public func setCloseButton(_ enabled: Bool) -> NfcTutorialConfigurationBuilder

Sets the image of the close button.

  • Parameters:

    • enabled: whether the close button should be shown or not. If set to false, the button dissapears.
  • Returns:

    • Builder itself.
@discardableResult
public func setCloseButtonImage(_ image: UIImage?) -> NfcTutorialConfigurationBuilder

Sets the image of the close button.

  • Parameters:

    • image: image to be shown in the close button. If nil, the close button dissappears.
  • Returns:

    • Builder itself.
public func build() -> NfcTutorialConfiguration

Builds the configuration builder and creates the error alert configuration.

  • Returns:

    • Configuration of the error alert.