Skip to content

Delegate vs dropviews principle #3

@jakubknejzlik

Description

@jakubknejzlik

One question/suggestion. I would like to know your opinion about leaving the decision of what view can be dropped in another view to the delegate and the interface shoudl be:

@interface UIView (DragDrop)

  • (void) makeDraggable;
  • (void) makeDroppable;
  • (void) setDragDropDelegate:(id)delegate;
  • (void) setDragMode:(UIViewDragDropMode)mode;
    @EnD

@protocol UIViewDragDropDelegate
....
@optional

  • (BOOL)draggableView:(UIView *)view shoudDropOnDroppableView:(UIView *)view;

....
@EnD

Looks easier to me when using it (i can dynamicaly add draggables/droppables and all is handled in delegate). Also method for destroying the draggable/droppable behaviour of view could be useful (something like -(void)destroyDraggable; -(void)destroyDroppable;)

Also if You are interested in any contribution It'll be my pleasure :)

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions