1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 15:53:44 +00:00

add/edit/delete custom fields. remove field page.

This commit is contained in:
Kyle Spearrin
2018-03-05 15:15:20 -05:00
parent c3f4d56d1e
commit 1f21a2ecc7
14 changed files with 459 additions and 304 deletions

View File

@@ -323,6 +323,27 @@ namespace Bit.iOS.Services
throw new NotImplementedException();
}
public Task<string> DisplayPromptAync(string title = null, string description = null, string text = null)
{
var result = new TaskCompletionSource<string>();
var alert = UIAlertController.Create(title ?? string.Empty, description, UIAlertControllerStyle.Alert);
UITextField input = null;
alert.AddAction(UIAlertAction.Create(AppResources.Cancel, UIAlertActionStyle.Cancel, x =>
{
result.TrySetResult(null);
}));
alert.AddAction(UIAlertAction.Create(AppResources.Ok, UIAlertActionStyle.Default, x =>
{
result.TrySetResult(input.Text ?? string.Empty);
}));
alert.AddTextField(x =>
{
input = x;
input.Text = text ?? string.Empty;
});
return result.Task;
}
private UIViewController GetPresentedViewController()
{
var window = UIApplication.SharedApplication.KeyWindow;