Example Project for Calling Objective-C APIs Asynchronously.
Method written Objective-C having specific format completion is automatically converted asynchronous functions in Swift.
- The method has a void return type.
- The block has a void return type.
- The block is called exactly once, on all possible paths of control flow.
For example,
- (void)handleVoidWithCompletion:(void (^)(void))completion;
can be called as below in Swift.
await objc.handleVoid()
- ObjC.h
- Definition of Objective-C methods.
- ObjC.m
- Implementation of Objective-C methods.
- AsyncObjCApp.swift
- Async func calls.