https://kotlinlang.org logo
Title
a

albertgao

01/30/2018, 4:48 AM
I want to declare a function type that returns nothing like
var successCallback: (result: String) -> Unit
, However the generated ObjC code is
@property NativeLibsStdlibUnit*(^errorCallback)(NSString*);
, I want to have a declaration at the swift side using something like this:
var successCallback: (_ result: String) -> Void
. Anything I did wrong? The official example are all return
Any
can’t find an example of returning
Unit
at the kotlin side which could be translated to
Void
in Swift side.
s

svyatoslav.scherbina

01/30/2018, 8:44 AM