Created
October 5, 2022 07:57
-
-
Save danailalexiev/e91af073ab2affdc079fbabf9710b5ff to your computer and use it in GitHub Desktop.
Kotlin Interface Swift Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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