一网通办ios
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Dsbridge.swift 675 B

2 年前
12345678910111213141516171819202122232425
  1. //
  2. // Dsbridge.swift
  3. // im-client-ios
  4. //
  5. // Created by 北京居家科技有限公司 on 2022/1/5.
  6. //
  7. import Foundation
  8. typealias JSCallback = (String, Bool)->Void
  9. class Dsbridge: NSObject {
  10. //MUST use "_" to ignore the first argument name explicitly。
  11. @objc func testSyn( _ arg:String) -> String {
  12. return String(format:"%@[Swift sync call:%@]", arg, "test")
  13. }
  14. @objc func testAsyn( _ arg:String, handler: JSCallback) {
  15. handler(String(format:"%@[Swift async call:%@]", arg, "test"), true)
  16. }
  17. @objc func takePhoto( _ arg:String) -> String {
  18. return String(format:"%@[Swift sync call:%@]", arg, "test")
  19. }
  20. }