pinkPanda 0 Newbie Poster

I'm trying to create simple game on xcode (swift) what I'm trying to do is moving player pieces from their positions how can I implement moving pieces from [number]positions to [number]positions for example from positions 1 to either 2 or 0 otherwise it get back to the previous positions

more details

so this is my game filed A & B represent player pieces (like in chess) each player have 3 pieces and I placed image view on each of these black point if player place one piece in position 1 in the next round they can move their piece from 1 to either position 0 or 2 or place another pieces the player can't move the piece to any other position if they try to move it to position 3,4,5..11 then the piece will go back to position 1 to win the game player need to place all their pieces in one line (eg player 1 place their pieces "A" in position 4,5,6,7 then he win the game) my question is I want

http://s17.postimg.org/kg62pyhbj/Untitled.png