Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix return type not supported error on iOS #480

Merged
merged 1 commit into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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