wendux / DSBridge-IOS

:earth_asia: A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

原生异步函数如何支持重载?

yanghl opened this issue · comments

@objc func testAsyn( _ arg:String, block: (String, Bool)->Void) {
block(String(format:"%@[Swift async call:%@]", arg, "test"), true)
}

@objc func testAsyn( _ arg:String, handler: (String, Bool)->Void) {
handler(String(format:"%@[Swift async call:%@]", arg, "test"), true)
}

比如这种情况 第二个函数js永远无法调用成功了