I have the method
public async Task doSomething()
Inside the method I have the code:
ShowSpinner();      
await System.Threading.Tasks.Task.Run(() =>
{
    try
    {
        getValue = value();
    }
    catch(Exception ex)
    {
    }
    finally
    {
        HideSpinner();
    }
    });
The ShowSpinner() and HideSpinner() are simply overlays to prevent the user from interacting with the screen and show a spinning wheel to indicate loading.
I am getting the error:
UIKit Consistency error: you are calling a UIKit method that can only be invoked from the UI thread.
I know that this is because of the HideSpinner(). How can I get around this consistency error?