LoadingState

public class LoadingState

Undocumented

  • Readable name for debugging

    Declaration

    Swift

    var readableName: String?
  • General completion handler of the loading state. Containens successCompletion and failCompletion

    Declaration

    Swift

    public var stateHandler: StateHandler?
  • Completion success handler of the loading state

    Declaration

    Swift

    var successCompletion: StateCallBack?
  • Completion fail handler of the loading state

    Declaration

    Swift

    var failCompletion: StateCallBack?
  • Parameter defines if state should ignore auto invocation call in case it is dependant state.

    Declaration

    Swift

    var willSkipingStateAutoInvocation: Bool
  • Checks if Loading state machine objects are equal

    Declaration

    Swift

    static func == (from: LoadingState,
                    to: LoadingState) -> Bool

    Parameters

    from

    first state machine instance to compare

    to

    second state machine instance to compare

    Return Value

    True if both object has same LoadingStateMachineGroups enum value, otherwise false

  • Defines state loading status

    Declaration

    Swift

    private(set) var loadingState: LoadingStateTypes { get set }
  • Delegate instance uses to pass information when Loading state changed loading status or finished work

    Declaration

    Swift

    var delegate: LoadingStateMachineDelegate?
  • State dependancies that will be called after current state will finish it’s work

    Declaration

    Swift

    var dependantStates: [String]
  • Type of the loading state

    Declaration

    Swift

    let name: String
  • Create new state instance with state type and dependant states

    Declaration

    Swift

    public init(dependantStatesIds: [String] = [])

    Parameters

    name

    State type

    dependantStates

    State dependancies that will be called after current state will finish it’s work

  • Remove dependancy on same state from current state

    Declaration

    Swift

    func removeDependancyOnSelf(dependantStatesIds: [String]) -> [String]

    Parameters

    dependantStates

    Array of dependancies states to check

    Return Value

    return filtered dependencies list without state duplication of Self State

  • Remove duplication from dependecies if was added, we are not allowing to have same dependency twice in a list

    Declaration

    Swift

    func removeDuplicationDependancies(dependantStatesIds: [String]) -> [String]

    Parameters

    dependantStates

    Array of dependancies states to check

    Return Value

    return filtered dependencies list duplication state

  • Start load state if state has not dependant states

    Declaration

    Swift

    @discardableResult
    func setStartLoadState() -> Bool
  • Force load state

    Declaration

    Swift

    private func loadState()
  • Pass inforamtion that other state finish its job

    Declaration

    Swift

    func stateDidFinishedJob(stateId: String)

    Parameters

    stateType

    state that finished job