implement search delegate

This commit is contained in:
Kyle Spearrin 2018-09-24 14:51:37 -04:00
parent b3e0b148a6
commit bc79f22e22

View file

@ -34,6 +34,7 @@ namespace Bit.iOS.Autofill
TableView.RowHeight = UITableView.AutomaticDimension;
TableView.EstimatedRowHeight = 44;
TableView.Source = new TableSource(this);
SearchBar.Delegate = new SearchDelegate(this);
await ((TableSource)TableView.Source).LoadItemsAsync(false, SearchBar.Text);
}
@ -76,7 +77,7 @@ namespace Bit.iOS.Autofill
private LoginSearchViewController _controller;
public TableSource(LoginSearchViewController controller)
:base(controller.Context, controller)
: base(controller.Context, controller)
{
_context = controller.Context;
_controller = controller;
@ -158,4 +159,19 @@ namespace Bit.iOS.Autofill
}
}
}
public class SearchDelegate : UISearchBarDelegate
{
private readonly LoginSearchViewController _controller;
public SearchDelegate(LoginSearchViewController controller)
{
_controller = controller;
}
public override void OnEditingStopped(UISearchBar searchBar)
{
base.OnEditingStopped(searchBar);
}
}
}