1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-23 03:33:59 +00:00

resolving warnings for obsolete APIs

This commit is contained in:
Kyle Spearrin
2017-05-30 14:13:53 -04:00
parent 65438e837d
commit 24382b8607
45 changed files with 160 additions and 123 deletions

View File

@@ -0,0 +1,26 @@
using System;
using Xamarin.Forms;
namespace Bit.App.Utilities
{
public static class Helpers
{
public static T OnPlatform<T>(T iOS = default(T), T Android = default(T),
T WinPhone = default(T), T Windows = default(T))
{
switch(Device.RuntimePlatform)
{
case Device.iOS:
return iOS;
case Device.Android:
return Android;
case Device.WinPhone:
return WinPhone;
case Device.Windows:
return Windows;
default:
throw new Exception("Unsupported platform.");
}
}
}
}