AsyncHelper
@available(iOS 13.0, macOS 10.15, *)
public enum AsyncHelper
Provides method for converting Callback based API into an async API
-
asyncifyCallback(closure:
Asynchronous) 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
BoxSDKErrorDeclaration
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