public override async void ViewDidLoad () { base.ViewDidLoad (); this.Title = "Popular Events"; this.TabBarController.TabBar.TintColor = UIColor.White; ParentViewController.NavigationController.SetNavigationBarHidden (true, true); NavigationItem.SetRightBarButtonItem( new UIBarButtonItem("Sign Out", UIBarButtonItemStyle.Plain, (object sender, EventArgs e) => { ParentViewController.NavigationController.DismissViewController(true, null); RestAPI.Session = null; KeychainUtil.ClearCredential(); Database.DB.ClearDatabase(); }), true); var infoButton = new UIBarButtonItem("", UIBarButtonItemStyle.Plain, (object sender, EventArgs e) => { Console.WriteLine("Info button pressed..."); }); NavigationItem.SetLeftBarButtonItem (infoButton, true); var gestureRecognizer = new UILongPressGestureRecognizer ((UILongPressGestureRecognizer gesture) => { if (gesture.State == UIGestureRecognizerState.Began) { Console.WriteLine("Info button long pressed..."); PerformSegue("SegueToBuildInfo", this); } }); gestureRecognizer.MinimumPressDuration = 1.0; // 1 second infoButton.GetView().AddGestureRecognizer (gestureRecognizer); var events = Database.DB.GetEventsStartingAtDate (DateTime.Today); tableSource = new EventTableSource<HomeTableViewController> (events, this, "HomeTableCellId"); TableView.Source = tableSource; await UpdateEvents (); // Get favorites on first load, so the heart buttons will be correctly populated // when navigating to an event. if (firstLoad) { await GetFavorites (); firstLoad = false; } }