Skip to content

Instantly share code, notes, and snippets.

@danailalexiev
Created October 5, 2022 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danailalexiev/e91af073ab2affdc079fbabf9710b5ff to your computer and use it in GitHub Desktop.
Save danailalexiev/e91af073ab2affdc079fbabf9710b5ff to your computer and use it in GitHub Desktop.
Kotlin Interface Swift Extension
import Foundation
import sdk
extension JokeClient {
func getRandomJokeAsync(jokeCategory: JokeCategory? = nil) async throws -> Joke {
return try await convertToAsync(kotlinCall: { completionHandler in
self.getRandomJoke(category: jokeCategory, completionHandler: completionHandler)
})
}
func getJokeCategoriesAsync() async throws -> [JokeCategory] {
return try await convertToAsync(kotlinCall: { completionHandler in
self.getJokeCategories(completionHandler: completionHandler)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment