xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.48k stars 514 forks source link

Missed `DispatchQueue.DispatchSync<T>(Func<T> func)` method #5002

Open mykyta-bondarenko opened 6 years ago

mykyta-bondarenko commented 6 years ago

Now we can pass only Action into the DispatchQueue.DispatchSync methods. But we can do it with the native API: https://developer.apple.com/documentation/dispatch/dispatchqueue/2016081-sync. Could we add methods with overloading Func<T>?

spouliot commented 6 years ago

dispatch_sync_f returns void.

Maybe we could do some hack with the void *context parameter do allow a return value.