AsyncHelper

@available(iOS 13.0, *)
public enum AsyncHelper

Provides method for converting Callback based API into an async API

  • Converting a Callback based API into an async API.

    Example of use:


    let folder = try? await AsyncHelper.asyncifyCallback { (callback: @escaping Callback) in client.folders.get(folderId: “12345”, completion: callback) }

    Throws

    BoxSDKError

    Declaration

    Swift

    public static func asyncifyCallback<T>(closure: (@escaping Callback<T>) -> Void) async throws -> T

    Parameters

    closure

    A closure with API call based on Callback

    Return Value

    Any result from the API call