krzysztof
08/06/2024, 9:30 PM@Throws
annotation at methods in an interface, to be implemented in iOS side? Having interface like this:
interface ExampleInterface {
@Throws(Exception::class)
fun doIt(): Boolean
}
And using implementing it on Swift side as:
func doIt() throws -> Bool {
// ...
}
gives an error :
Throwing method cannot be an implementation of an @objc requirement because it returns a value of type 'Bool'; return 'Void' or a type that bridges to an Objective-C class
François
08/07/2024, 8:04 AMinterface ExampleInterface {
@Throws(Exception::class)
suspend fun doIt(): Boolean
}
class DummyTest: ExampleInterface {
func doIt() async throws -> KotlinBoolean {
return true
}
}
François
08/07/2024, 8:08 AMkrzysztof
08/07/2024, 8:58 AMdoIt
as overload), so that not working for me. Which Kotlin version you use?François
08/07/2024, 9:03 AMMichael Krussel
08/08/2024, 12:13 PMFrançois
08/08/2024, 12:15 PMkrzysztof
08/08/2024, 1:05 PMFrançois
08/08/2024, 1:06 PMkrzysztof
08/08/2024, 1:13 PM