@@ -289,6 +289,11 @@ - (void)dk_handleLongPress:(UIGestureRecognizer *)sender {
289
289
if (droppedTarget) {
290
290
CGPoint centerOfView = [[droppedTarget.dropView superview ] convertPoint: droppedTarget.dropView.center toView: [self dk_mainAppWindow ]];
291
291
292
+ // TODO: Fix this message.
293
+ if ([droppedTarget.dropDelegate respondsToSelector: @selector (dropCompletedOnTargetView:withView: )]) {
294
+ [droppedTarget.dropDelegate dropCompletedOnTargetView: droppedTarget.dropView withView: nil ];
295
+ }
296
+
292
297
// collapse the drag view into the drop view.
293
298
[self dk_collapseDragViewAtPoint: centerOfView];
294
299
@@ -440,11 +445,11 @@ - (void)dk_messageTargetsHitByPoint:(CGPoint)point {
440
445
if (CGRectContainsPoint (target.frameInWindow , point)) {
441
446
// message the target.
442
447
443
- // TODO: Make the DKDropTarget message the view?
444
-
445
448
[self dk_setView: target.dropView highlighted: YES animated: YES ];
446
449
447
- if (!target.containsDragView ) [target.dropDelegate dragDidEnterTargetView: target.dropView];
450
+ if (!target.containsDragView && [target.dropDelegate respondsToSelector: @selector (dragDidEnterTargetView: )]) {
451
+ [target.dropDelegate dragDidEnterTargetView: target.dropView];
452
+ }
448
453
449
454
target.containsDragView = YES ;
450
455
@@ -453,7 +458,9 @@ - (void)dk_messageTargetsHitByPoint:(CGPoint)point {
453
458
454
459
[self dk_setView: target.dropView highlighted: NO animated: YES ];
455
460
456
- if (target.containsDragView ) [target.dropDelegate dragDidLeaveTargetView: target.dropView];
461
+ if (target.containsDragView && [target.dropDelegate respondsToSelector: @selector (dragDidLeaveTargetView: )]) {
462
+ [target.dropDelegate dragDidLeaveTargetView: target.dropView];
463
+ }
457
464
458
465
target.containsDragView = NO ;
459
466
}
0 commit comments