开发者

How "Our Choice" app does the pinch and enlarge to view content part?

开发者 https://www.devze.com 2023-03-17 14:14 出处:网络
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. W

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消