Skip to content

Commit adfdea8

Browse files
committed
add docs
1 parent 7ce00dd commit adfdea8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Sources/SwiftJavaDocumentation/Documentation.docc/SupportedFeatures.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,19 @@ which conform a to a given Swift protocol.
328328

329329
#### Returning protocol types
330330
Protocols are not yet supported as return types.
331+
332+
### `async` methods
333+
334+
> Note: Importing `async` methods is currently only available in the JNI mode of jextract.
335+
336+
Asynchronous methods in Swift can be extraced using different modes, which are explained in detail below.
337+
338+
#### Async mode: completable-future (default)
339+
340+
In this mode `async` methods in Swift are extracted as methods returning a `java.util.concurrent.CompletableFuture`.
341+
This mode gives the most flexibility and should be prefered if your platform supports `CompletableFuture`.
342+
343+
#### Async mode: future
344+
345+
This is a mode for legacy platforms, where `CompletableFuture` is not available, such as Android 23 and below.
346+
In this mode `async` methods in Swift are extracted as methods returning a `java.util.concurrent.Future`.

0 commit comments

Comments
 (0)