BFApp

public enum BFApp

This class adds some useful functions for the App.

  • Use this var to set you DEBUG or not builds. More info on how to use it here.

    Declaration

    Swift

    public static var isDebug: Bool
  • Executes a block only if in DEBUG mode.

    Declaration

    Swift

    public static func debug(_ block: () -> Void)

    Parameters

    block

    The block to be executed.

  • Executes a block only if NOT in DEBUG mode.

    Declaration

    Swift

    public static func release(_ block: () -> Void)

    Parameters

    block

    The block to be executed.

  • If version is set returns if is first start for that version, otherwise returns if is first start of the App.

    Declaration

    Swift

    public static func isFirstStart(version: String = "") -> Bool

    Parameters

    version

    Version to be checked, you can use the variable BFApp.version to pass the current App version.

    Return Value

    Returns if is first start of the App or for custom version.

  • Executes a block on first start of the App, if version is set it will be for given version.

    Remember to execute UI instuctions on main thread.

    Declaration

    Swift

    public static func onFirstStart(version: String = "", block: (_ isFirstStart: Bool) -> Void)

    Parameters

    version

    Version to be checked, you can use the variable BFApp.version to pass the current App version.

    block

    The block to execute, returns isFirstStart.

  • Reset the App like has never been started.

    Declaration

    Swift

    public static func resetFirstStart(version: String = "")

    Parameters

    version

    Version to be checked, you can use the variable BFApp.version to pass the current App version.

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public static func setAppSetting(object: Any, forKey objectKey: String) -> Bool
  • Get the App setting for a given key.

    Declaration

    Swift

    public static func getAppSetting(objectKey: String) -> Any?

    Parameters

    objectKey

    Key to get the object.

    Return Value

    Returns the object for the given key.