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.

  1. create cgrect variable named img1rect store rectangle of 1st image , img2rect variable (i think you've got what)
  2. 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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -