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
cgrectvariable namedimg1rectstore rectangle of 1st image ,img2rectvariable (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
img1rectframe 2nd image ,img2rectframe 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