This is a C# question although the code is written using Xamarin iOS. I would like to find out how I can combine a Task method with an async function and callback delegate. So in the code sample below I would like to call await ExecuteGetAsync() and wait until SendAsynchronousRequest() completes.
private async Task<CustomHttpResponse> ExecuteGetAsync(CustomHttpRequest inRequest)
{
NSUrlConnection
.SendAsynchronousRequest(
(NSUrlRequest)request,
NSOperationQueue.MainQueue,
delegate(NSUrlResponse inResponse, NSData inData, NSError inError)
{
// Return the response somehow
});
}