一网通办ios
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

26 linhas
675 B

  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. }