@interface UIView (Gestures) // undocumented SDK extension
- (void)zoomToScale:(float)scale;
- (void)rotateToDegrees:(float)degrees;
- (void)setRotationDegrees:(float)degrees duration:(NSTimeInterval)duration;
- (float)rotationDegrees;
- (void)setZoomScale:(float)scale duration:(NSTimeInterval)duration;
- (float)zoomScale;
@end
- (void)zoomToScale:(float)scale;
- (void)rotateToDegrees:(float)degrees;
- (void)setRotationDegrees:(float)degrees duration:(NSTimeInterval)duration;
- (float)rotationDegrees;
- (void)setZoomScale:(float)scale duration:(NSTimeInterval)duration;
- (float)zoomScale;
@end
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
if(type == 2) return View;
else if(type == 1) return Panel;
return nil;
}
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
{
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan:touches withEvent:event];
UITouch *touch = [touches anyObject];
if ([touch tapCount] == 2)
{
if(type == 1) {
[Panel setZoomScale:1.0 duration:0.2];
}
else if(type == 2) {
[View setZoomScale:1.0 duration:0.2];
}
}
}
if(type == 2) return View;
else if(type == 1) return Panel;
return nil;
}
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
{
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan:touches withEvent:event];
UITouch *touch = [touches anyObject];
if ([touch tapCount] == 2)
{
if(type == 1) {
[Panel setZoomScale:1.0 duration:0.2];
}
else if(type == 2) {
[View setZoomScale:1.0 duration:0.2];
}
}
}
'Apple - IPhone / IPod Touch > App 소개' 카테고리의 다른 글
UIToolbar 오른쪽 정렬 (0) | 2010.02.24 |
---|---|
iPhone App 아이콘 클리어타입으로 만들기 (0) | 2010.02.24 |
무료앱에서 유료 앱 링크 걸때.. (0) | 2010.01.25 |