objective c - How to implement exchanging items' locations by drag and drop -
i working on mac application have ran road block. trying create 2 images , make can dragged , dropped swap locations. lost here thorough explanation appreciated! i'm not new programing ive been working xcode , objective c few months. in advance!
the similar way true images. difference replacing 2 objects @ same time, should create 2 temporary variables.
- create
cgrect
variable namedimg1rect
store rectangle of 1st image ,img2rect
variable (i think you've got what) - drag 1st image onto 2nd, place. if dragg'n'drop successfull (e.g. check whether touch coordinate located on 2nd mage) set
img1rect
frame 2nd image ,img2rect
frame 1st.
if matter of question drag'n'drop handling find plenty of information using search. example, chck out: basic drag , drop in ios
Comments
Post a Comment