一网通办ios
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dsbridge.swift 675 B

2 vuotta sitten
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. }