public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            btnMenu.TouchUpInside += (sender, e) =>
            {
                MainViewController.Instance.AnimateMenuOpen();
            };

            var layout = cvPager.CollectionViewLayout as UICollectionViewFlowLayout;

            layout.ItemSize = new CoreGraphics.CGSize(UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height - 120);

            var controllers    = new List <UIViewController> ();
            var feedController = Storyboard.InstantiateViewController <FeedViewController> ();

            AddChildViewController(feedController);
            controllers.Add(feedController);

            scoresController = Storyboard.InstantiateViewController <ScoresViewController> ();
            AddChildViewController(scoresController);
            controllers.Add(scoresController);

            var rankingsController = Storyboard.InstantiateViewController <RankingsViewController> ();

            AddChildViewController(rankingsController);
            controllers.Add(rankingsController);

            var source = new CustomCollectionSource <UIViewController> (controllers, GetCell);

            cvPager.Source = source;
            cvPager.ReloadData();

            cvPager.Delegate = null;

            cvPager.Scrolled += (sender, e) =>
            {
                int position = (int)(cvPager.ContentOffset.X / UIScreen.MainScreen.Bounds.Width);
                if (cvPager.ContentOffset.X % UIScreen.MainScreen.Bounds.Width > (UIScreen.MainScreen.Bounds.Width / 2f))
                {
                    position++;
                }

                if (position == 1)
                {
                    ShowHelpIfNecessary(TutorialHelper.SchedulesScores);
                }

                SetButtonColor(position);

                lcIndicatorLeading.Constant = cvPager.ContentOffset.X / 3f;
            };

            btnFeed.TouchUpInside += (sender, e) =>
            {
                ScrollToPosition(0);
            };

            btnScores.TouchUpInside += (sender, e) =>
            {
                ScrollToPosition(1);
            };

            btnRankings.TouchUpInside += (sender, e) =>
            {
                ScrollToPosition(2);
            };

            btnSearch.TouchUpInside += (sender, e) =>
            {
                var controller = Storyboard.InstantiateViewController <SearchViewContrroller>();
                NavigationController.PushViewController(controller, true);
            };

            btnNotifications.TouchUpInside += (sender, e) =>
            {
                var controller = Storyboard.InstantiateViewController <NotificationsViewController>();
                NavigationController.PushViewController(controller, true);
            };

            btnExplore.TouchUpInside += (sender, e) =>
            {
                var controller = Storyboard.InstantiateViewController <FavoritesViewController>();
                NavigationController.PushViewController(controller, true);
            };

            lblNotificationCount.Superview.Hidden = true;
            GetNotifications();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ShowHelpIfNecessary(TutorialHelper.TagEvents);

            btnBack.TouchUpInside += (sender, e) => NavigationController.PopViewController(true);
            var times = new List <DateTime>();

            currentTime = DateTime.Now.Date.ToUniversalTime();
            var startTime = DateTime.Now.Date.ToUniversalTime().AddDays(-2);

            for (int i = 0; i < 5; i++)
            {
                times.Add(startTime.AddDays(i));
            }

            var layout = cvDates.CollectionViewLayout as UICollectionViewFlowLayout;

            layout.ItemSize = new CoreGraphics.CGSize(UIScreen.MainScreen.Bounds.Width / 5, cvDates.Frame.Height);

            daysSource            = new CustomCollectionSource <DateTime>(times, GetCollectionCell);
            daysSource.ItemClick += (sender, e) =>
            {
                currentTime = e;
                cvDates.ReloadData();
                GetData();
            };
            cvDates.Source = daysSource;

            tvEvents.EstimatedRowHeight = 100;
            tvEvents.RowHeight          = UITableView.AutomaticDimension;
            eventsSource = new CustomListSource <EventProfile>(new List <EventProfile>(), GetCell, (arg1, arg2) => UITableView.AutomaticDimension);
            eventsSource.NoContentText = "No Events";
            eventsSource.ItemClick    += (sender, e) =>
            {
                if (Post.Events.Contains((e.Id)))
                {
                    Post.Events.Remove(e.Id);
                }
                else
                {
                    Post.Events.Add(e.Id);
                }

                tvEvents.ReloadData();
            };
            tvEvents.Source = eventsSource;
            GetData();

            btnPost.TouchUpInside += (sender, e) =>
            {
                if (Post.Videos.Any(m => string.IsNullOrEmpty(m.Id)))
                {
                    var controller = UIAlertController.Create("Video Upload", "You video will be uploaded in the background and the post will be made visible once the upload is complete", UIAlertControllerStyle.Alert);
                    controller.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, (obj) =>
                    {
                        SavePost();
                    }));
                    PresentViewController(controller, true, null);
                }
                else
                {
                    SavePost();
                }
            };

            if (!string.IsNullOrEmpty(Post.Id))
            {
                btnShare.Hidden = true;
            }

            btnShare.TouchUpInside += (sender, e) =>
            {
                UIActionSheet sheet = new UIActionSheet("Share On");
                if (Post.Images.Any() || Post.Links.Any() || Post.Videos.Any())
                {
                    sheet.AddButton("Facebook");
                }
                sheet.AddButton("Other");
                sheet.AddButton("Cancel");
                sheet.Clicked += async(sender2, e2) =>
                {
                    nint index = e2.ButtonIndex;
                    if (!Post.Images.Any() && !Post.Links.Any() && !Post.Videos.Any())
                    {
                        index++;
                    }
                    if (index == 0)
                    {
                        await Sharer.ShareFacebook(this, Post);

                        Post.IsShared = true;
                    }
                    else if (index == 1)
                    {
                        await Sharer.ShareOther(this, Post, () =>
                        {
                            Post.IsShared = true;
                        });
                    }
                };
                sheet.ShowInView(View);
            };
        }