The said app can be seen here: http://pushpoppress.com/ourchoice/. What interests me is the part whe开发者_StackOverflowre they can freely pinch the thumbnails at the bottom to enlarge to full view. Would be interesting to replicate such effect.
Any ideas guys?
To rotate the image:
import math.h
in touchesbegan: find firsttouch, secondtouch, etc.
then: float startdirection = tanh((firsttouch.y-secondtouch.y)/(firsttouch.x-secondtouch.x));
in touchesmoved: find firsttouch, secondtouch again, then:
float newdirection = tanh((firsttouch.y-secondtouch.y)/(firsttouch.x-secondtouch.x));
image.transform = CGAffineTransformMakeRotation(newdirection-startdirection);
You could use touchesBegan but enumerate the touches and use the distance between the points, their positions, etc. to manipulate the size and position of a UIImageView. Then if the distance is large enough it could automatically jump to full screen.
精彩评论