KKServices

public class KKServices

KKServices is the object that serves as a provider for KurozoraKit services.

KKServices is used together with KurozoraKit to provide extra functionality such as storing sensetive information in Keychain and showing success/error alerts. For further control over the information saved in Keychain, you can provide your own Keychain object with your specified properties.

  • Tag: KKServices
  • Provides access to the Keychain service used by KurozoraKit.

    Declaration

    Swift

    internal var _keychainDefaults: Keychain!
  • Provides access to the Keychain service used by KurozoraKit.

    Declaration

    Swift

    var keychainDefaults: Keychain { get }
  • Show or hide expressive success/error alerts to users.

    If set to true, whenever the API request encounters an error or receives an informational message, an expressive alert is shown to the users.

    Declaration

    Swift

    var showAlerts: Bool

Initializers

  • KKServices is a root object, that serves as a provider for KurozoraKit services.

    Declaration

    Swift

    public init(keychain: Keychain = Keychain(), showAlerts: Bool = true)

    Parameters

    keychain

    The main Keychain service used for managing secrets.

    showAlerts

    Show or hide expressive success/error alerts to users.

Functions

  • Sets the showAlert property with the given boolean value.

    Declaration

    Swift

    func showAlerts(_ bool: Bool) -> Self

    Parameters

    bool

    A boolean value indicating whether to show or hide expressive success/error alerts.

    Return Value

    Reference to self.

  • Sets the keychainDefaults property with the given Keychain object.

    Declaration

    Swift

    func keychainDefaults(_ keychain: Keychain) -> Self

    Parameters

    keychain

    An object representing the desired Keychain properties to use.

    Return Value

    Reference to self.