1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-26 21:23:46 +00:00

some device functions

This commit is contained in:
Kyle Spearrin
2019-05-17 13:46:32 -04:00
parent 3e633dc38e
commit a3e165fa06
3 changed files with 28 additions and 11 deletions

View File

@@ -248,6 +248,22 @@ namespace Bit.iOS.Services
return true;
}
public int SystemMajorVersion()
{
var versionParts = UIDevice.CurrentDevice.SystemVersion.Split('.');
if(versionParts.Length > 0 && int.TryParse(versionParts[0], out int version))
{
return version;
}
// unable to determine version
return -1;
}
public string SystemModel()
{
return UIDevice.CurrentDevice.Model;
}
private void ImagePicker_FinishedPickingMedia(object sender, UIImagePickerMediaPickedEventArgs e)
{
if(sender is UIImagePickerController picker)
@@ -364,16 +380,5 @@ namespace Bit.iOS.Services
var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
return Path.Combine(documents, "..", "tmp");
}
private int SystemMajorVersion()
{
var versionParts = UIDevice.CurrentDevice.SystemVersion.Split('.');
if(versionParts.Length > 0 && int.TryParse(versionParts[0], out int version))
{
return version;
}
// unable to determine version
return -1;
}
}
}