objective c - Swap positions UIImageViews second time Xcode -


i have problem. when use code below, can swap same uiimageviews first time. second time, go original position or overlay each other.

example code:

if (cgrectintersectsrect(view1.frame, view2.frame)) {    [uiview animatewithduration:0.2 animations:^{      cgrect view1frame = view1.frame;      view1.frame = view2.frame;      view2.frame = view1frame;    }]; } 

how can swap positions of uiimageviews every time? appreciated!

did make method?

-(void) swaplocwith: (uiview *) view1 and: (uiview *) view2 {    //your code sample here } ... -(void) somemethod {     //swap once     [self swaplocwith: view1 and: view2];      //swap     [self swaplocwith: view2 and: view1]; } 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -