Enumerations

The following enumerations are available globally.

  • Enum for the possible API errors.

    Subspec: Utility/APIError

    func decodeData<T: Decodable>(_ data: Data?) -> Result<T> {
        guard let data = data else {
            return Result.failure(APIErrorType.noDataRetreived)
        }
    
        do {
            let model = try decoder.decode(T.self, from: data)
            return Result.success(model)
        } catch {
            return decodeError(data, decodeError: error)
        }
    }
    

    When decoding the objects from an API errors can be identified with the APIErrorType. In the example above the APIErrorType is used to identify when no data is returned from the API. The other options allows for identifying failed deserializations and custom error codes through the APIError model.

    • backend: Custom error message from backend.
    • noDataRetreived: Used when the data is nil from the api.
    • deserializationFailed: Used when the data can’t be deserialized into the desired model.
    See more

    Declaration

    Swift

    public enum APIErrorType : Error
  • Enum to determine the password type.

    Subspec: Validation/ValidationType

    • lowercasedLetters
    • uppercasedLetters
    • specialCharacters
    • numbers
    • minCharacters
    See more

    Declaration

    Swift

    public enum ValidationType
  • Enumerates possible directions the page control can move.

    Subspec: Views/InfinityPageControl

    • left: Left move.
    • right: Right move.
    • none: No move.
    See more

    Declaration

    Swift

    enum PageControlDirection
  • The size state for the PagingDot

    Subspec: Views/InfinityPageControl

    • large: Large.
    • medium: Medium.
    • small: Small.
    • hidden: Hidden.
    See more

    Declaration

    Swift

    enum PagingDotState
  • Paging dot state change.

    • noChange: No change.
    • shrink: Shrink.
    • expand: Expand.
    See more

    Declaration

    Swift

    enum PagingDotStateMachine