let position = gestureRecognizer.location(in: self) let convertedPosition = convert(position, to: collectionView) switch gestureRecognizer.state { case .began: delegate?.didStartLongPress(position: convertedPosition) case .changed: delegate?.didChangeLongPress(position: convertedPosition) case .ended: delegate?.didEndLongPress(position: convertedPosition) case .cancelled, .failed: delegate?.didCancelLongPress(position: convertedPosition) case .possible: break // do nothing } }
let position = gestureRecognizer.location(in: self) let convertedPosition = convert(position, to: collectionView) switch gestureRecognizer.state { case .began: delegate?.didStartLongPress(position: convertedPosition) case .changed: delegate?.didChangeLongPress(position: convertedPosition) case .ended: delegate?.didEndLongPress(position: convertedPosition) case .cancelled, .failed: delegate?.didCancelLongPress(position: convertedPosition) case .possible: break // do nothing } }
let position = gestureRecognizer.location(in: self) let convertedPosition = convert(position, to: collectionView) switch gestureRecognizer.state { case .began: delegate?.didStartLongPress(position: convertedPosition) case .changed: delegate?.didChangeLongPress(position: convertedPosition) case .ended: delegate?.didEndLongPress(position: convertedPosition) case .cancelled, .failed: delegate?.didCancelLongPress(position: convertedPosition) case .possible: break // do nothing } }