
因为上面图片是用的UICollectionViewDragDelegate``UICollectionViewDropDelegate
方式处理的。(没办法当初赶工期,直接用的同事的实现方式。)
总之,采用下面的额方式可以禁掉drop到文本框
tf.textDropDelegate = self
// 代理方法中禁用掉
func textDroppableView(_ textDroppableView: UIView & UITextDroppable, proposalForDrop drop: UITextDropRequest) -> UITextDropProposal {
return UITextDropProposal(operation: .forbidden)
}
网友评论