public bool ShouldReceiveTouch(UIGestureRecognizer gestureRecognizer, UITouch touch) { if (gestureRecognizer == longPressGestureRecognizer) { var point = touch.LocationInView(CollectionView); var thereIsAnItemAtPoint = dataSource.CalendarItemAtPoint(point) != null; var isNotEditing = dataSource.IsEditing == false; return(thereIsAnItemAtPoint && isNotEditing); } return(true); }
private void longPressBegan(CGPoint point) { if (dataSource.IsEditing || isActive) { return; } var itemAtPoint = dataSource.CalendarItemAtPoint(point); if (!itemAtPoint.HasValue) { return; } calendarItem = itemAtPoint.Value; if (!calendarItem.IsEditable()) { return; } itemIndexPath = CollectionView.IndexPathForItemAtPoint(point); dataSource.StartEditing(itemIndexPath); becomeActive(); var startPoint = Layout.PointAtDate(calendarItem.StartTime.ToLocalTime()); firstPoint = point; LastPoint = point; previousPoint = point; verticalOffset = firstPoint.Y - startPoint.Y; impactFeedback.ImpactOccurred(); selectionFeedback.Prepare(); }