If there is an answer which covers my question, please give me a link to it. Otherwise here is my question:
I am currently running Swift 2.0 (Xcode 7) Sprite Kit Game and would like to know wether it would be possible for a UIImageView
to follow another UIImageView
.
So when someone swipes in any direction, the first UIImageView
will go that direction, and another will follow it like a snake and they all follow the one in front of them.
Edit: I would like to work like a snake. So I have many UIImageViews which represent body parts of the snake (basically small black dots) and whichever direction the head goes in which is controlled by UISwipeGestureRecogniser the others parts follow.
The most easy way is to use UIScrollView
with pagingEnabled
property enabled. At raywenderlich you can find small tutorial.
Much better way is to use UIPageViewController
, example
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.