1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 08:13:20 +00:00

MAUI Sample iOS Extension Tap gesture workaround

This commit is contained in:
Federico Maccaroni
2023-12-26 18:47:59 -03:00
parent fa022a1a4f
commit ca95ada8e8
56 changed files with 2928 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
namespace Core
{
public static class TaskExtensions
{
/// <summary>
/// Fires a task and ignores any exception.
/// See http://stackoverflow.com/a/22864616/344182
/// </summary>
/// <param name="task">The task to be forgotten.</param>
/// <param name="onException">Action to be called on exception.</param>
public static async void FireAndForget(this Task task, Action<Exception> onException = null)
{
try
{
await task.ConfigureAwait(false);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
onException?.Invoke(ex);
}
}
}
}