Friday 1 December 2017

c# - async in override context

I am working on an iOS Xamarin Project. I need to create a
share extension.



In a share extension, we can
override this method:



 public
override SLComposeSheetConfigurationItem[]
GetConfigurationItems()



I
want to call async methods in this method.
So i need to put an async keyword
like this:



 public override async
Task
GetConfigurationItems()


But
C# compiler gives me an error, because override initial method has not this signature.
So i do not know how to
do...



Thanks




**
EDIT **



Here is full
example



 public override
SLComposeSheetConfigurationItem[] GetConfigurationItems()
{
// To
add configuration options via table cells at the bottom of the sheet, return an array of
SLComposeSheetConfigurationItem here.


var result =
await service.make_computation());

....

}

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...