async Task Search(string searchTerm) { var stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); try { if (string.IsNullOrEmpty(searchBar.Text)) { return; } searchResults = await viewModel.Search(searchTerm); source = new DiscoverBeerSearchResultsSource(searchResults); source.DidSelectBeer += BeerSelected; beerResultsTable.Source = source; beerResultsTable.ReloadData(); View.BringSubviewToFront(beerResultsTable); } catch (Exception ex) { logger.Report(ex, "DiscoverViewController", "Search"); } finally { stopWatch.Stop(); } }
async Task Search(string searchTerm) { var stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); try { if (string.IsNullOrEmpty(searchBar.Text)) return; searchResults = await viewModel.Search(searchTerm); source = new DiscoverBeerSearchResultsSource(searchResults); source.DidSelectBeer += BeerSelected; beerResultsTable.Source = source; beerResultsTable.ReloadData(); View.BringSubviewToFront(beerResultsTable); } catch (Exception ex) { logger.Report(ex, "DiscoverViewController", "Search"); } finally { stopWatch.Stop(); } }