Table of Contents

Class IosUtils

Namespace
VpnHood.Core.Client.Devices.Ios.Utils
Assembly
VpnHood.Core.Client.Devices.Ios.dll

Provides the running of work on the UI (main) thread: the iOS counterpart of AndroidUtils.

public static class IosUtils
Inheritance
IosUtils
Inherited Members

Methods

RunOnUiThread(Action)

Runs an action on the UI thread: at once where the caller is on it, or else queued there.

public static Task RunOnUiThread(Action action)

Parameters

action Action

The action.

Returns

Task

A task that completes when the action has run, or fails with its exception.

Remarks

Where the action is queued, its task completes with continuations run asynchronously, not inline on the UI thread; where it runs at once, the task is already complete.

RunOnUiThread<T>(Func<T>)

Runs a function on the UI thread: at once where the caller is on it, or else queued there.

public static Task<T> RunOnUiThread<T>(Func<T> action)

Parameters

action Func<T>

The function.

Returns

Task<T>

A task whose result is the function's, or that fails with its exception.

Type Parameters

T

The type of the function's result.

Remarks

Where the function is queued, its task completes with continuations run asynchronously, not inline on the UI thread; where it runs at once, the task is already complete.