I'm implementing drag-n-drop on
What I need is to get a frame of drag preview (see below, red rectangle)
I tried to get drag's location:
I also tried to store
from Get frame of Drag preview
UICollectionView
using a new Apple's API introduced in iOS 11.What I need is to get a frame of drag preview (see below, red rectangle)
I tried to get drag's location:
extension ViewController: UICollectionViewDropDelegate {
func collectionView(_ collectionView: UICollectionView,
dropSessionDidUpdate session: UIDropSession,
withDestinationIndexPath destinationIndexPath: IndexPath?) -> UICollectionViewDropProposal {
let location = session.location(in: collectionView)
}
but it represents my finger's location only. I need to get the entire frame or, at least, it's origin.I also tried to store
y
position of touch in my cell and then do something like dragLocation.y - touchLocationInCell.y
, but this approach is not accurate: looks like the preview gets some offset from the touch location.from Get frame of Drag preview
No comments:
Post a Comment