Extensions

The following extensions are available globally.

  • Future<T>

    A Future is a swift generic class that let’s you represent an object that will be returned at somepoint in the future. Usually from some asynchronous operation that may be running in a different thread/dispatch_queue or represent data that must be retrieved from a remote server somewhere.

    See more

    Declaration

    Swift

    public class Future<T> : FutureProtocol
  • Defines a simple enumeration of the legal Completion states of a Future.

    • case Success(T): the Future has completed Succesfully.
    • case Fail(ErrorType): the Future has failed.
    • case Cancelled: the Future was cancelled. This is typically not seen as an error.
    See more

    Declaration

    Swift

    public enum FutureResult<T>
  • Defines a an enumeration that can be used to complete a Promise/Future.

    • Success(T): The Future should complete with a FutureResult.Success(T)

    • Fail(ErrorType): The Future should complete with a FutureResult.Fail(ErrorType)

    • Cancelled:
      The Future should complete with with FutureResult.Cancelled.

    • CompleteUsing(Future):
      The Future should be completed with the result of a another dependent Future, when the dependent Future completes.

      If The Future receives a cancelation request, than the cancellation request will be forwarded to the depedent future.

    See more

    Declaration

    Swift

    public enum Completion<T>