Skip to content

Commit

Permalink
fix: fix return type not supported error on iOS (AgoraIO-Extensions#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
littleGnAl committed Oct 27, 2021
1 parent 66c45c6 commit a96b210
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions ios/Classes/Base/Callback.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ extension Callback {
}

let res = runnable?(code)
if res is Void {
success(nil)
} else {
success(res)
}
success(res)
}

func resolve<T>(_ source: T?, _ runnable: (T) -> Any?) {
Expand All @@ -40,10 +36,6 @@ extension Callback {
}

let res = runnable(source)
if res is Void {
success(nil)
} else {
success(res)
}
success(res)
}
}
2 changes: 1 addition & 1 deletion ios/Classes/Base/RtcEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class RtcEngineManager: NSObject, RtcEngineInterface {
callback.resolve(engine) { [weak self] _ in
self?.Release()
RtcEngineRegistry.shared.onRtcEngineDestroyed()
return Void.self
return nil
}
}

Expand Down

0 comments on commit a96b210

Please sign in to comment.