private void AddLocalTag(string txt, bool shouldClear = true) { if (_viewSource.LocalTags.Contains(txt)) { ShowAlert(Core.Localization.LocalizationKeys.DuplicateTag); return; } if (!string.IsNullOrWhiteSpace(txt) && _viewSource.LocalTags.Count < 20) { if (shouldClear) { _tagField.Clear(); } _viewSource.LocalTags.Add(txt); SetCollectionHeight(); _flowDelegate.GenerateVariables(); tagsCollectionView.ReloadData(); tagsCollectionView.ScrollToItem(NSIndexPath.FromItemSection(_viewSource.LocalTags.Count - 1, 0), UICollectionViewScrollPosition.Right, true); } }