Other Functions

The following functions are available globally.

  • Calls an expression asynchronously and returns the result of the expressin in a the completion callback

    async(closingOver: loadVideoFile()) { result in
       switch result {
       case let .success(videoFil):
           break
       case let .failure(error):
           break
    }
    

    Declaration

    Swift

    public func async<R>(closingOver closure: @autoclosure @escaping () -> R, completion: ((Result<R, Error>) -> Void)? = nil)

    Parameters

    closure

    the expression to call asynchronously

    completion

    the callback with the result of the closure

  • Calls a block of code asynchronously

    Declaration

    Swift

    public func async(executing block: @escaping () -> Void)

    Parameters

    block

    the block of code that should be called asynchronously