Rotation puzzle game animation frame
I'm building a puzzle game called Rotation. Rotation has one table 3x3 with numbers 1-9 in it and the users tried to put the numbers in the right order rotating the 4 of them (one set). So in my UI, i have 9 UIImgaeViews an 4 buttons to do the rotation of the sets.

In the first set of images i have the following code to do the animation part of rotation:

    -(void)animateNumbers
    {
      [UIView beginAnimations:nil context:nil];
      [UIView setAnimationDuration:1.0];
      //[UIView setAnimationDelay:1.0];
      [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
        
      CGRect pos00Frame = img1.frame;
      CGRect pos01Frame = img2.frame;
      CGRect pos10Frame = img5.frame;
      CGRect pos11Frame = img4.frame;
            
      img1.frame = pos01Frame;
      img4.frame = pos00Frame;
      img5.frame = pos10Frame;
      img2.frame = pos11Frame;
    
      [UIView commitAnimations];

}

My problem is when i random all the 9 numbers in the game, i can't do the rotation part of this function because i don't know which picture is in the set. So my function isn't working properly. In some way, i have to know where & which are the numbers in the UI at any time! I tried to tag them but no progress with that. Any ideas?
Rotation puzzle game animation frame
===

I'm building a puzzle game called Rotation. Rotation has one table 3x3 with numbers 1-9 in it and the users tried to put the numbers in the right order rotating the 4 of them (one set). So in my UI, i have 9 UIImgaeViews an 4 buttons to do the rotation of the sets.

In the first set of images i have the following code to do the animation part of rotation:

    -(void)animateNumbers
    {
      [UIView beginAnimations:nil context:nil];
      [UIView setAnimationDuration:1.0];
      //[UIView setAnimationDelay:1.0];
      [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
        
      CGRect pos00Frame = img1.frame;
      CGRect pos01Frame = img2.frame;
      CGRect pos10Frame = img5.frame;
      CGRect pos11Frame = img4.frame;
            
      img1.frame = pos01Frame;
      img4.frame = pos00Frame;
      img5.frame = pos10Frame;
      img2.frame = pos11Frame;
    
      [UIView commitAnimations];

}

My problem is when i random all the 9 numbers in the game, i can't do the rotation part of this function because i don't know which picture is in the set. So my function isn't working properly. In some way, i have to know where & which are the numbers in the UI at any time! I tried to tag them but no progress with that. Any ideas?