macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

phase

INDEX>UIKit>UITouch

@property(nonatomic, readonly) UITouchPhase phase

解説

引数

UITouchPhase

クラス

UITouch

Property

使用可能

iPhone2.0

参照

例文

- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
{
	UITouch*			touch = [touches anyObject];
	
	switch ([touch phase]) {
		case UITouchPhaseBegan:
			NSLog(@"UITouchPhaseBegan");
			break;
		case UITouchPhaseMoved:
			NSLog(@"UITouchPhaseMoved");
			break;
		case UITouchPhaseStationary:
			NSLog(@"UITouchPhaseStationary");
			break;
		case UITouchPhaseEnded:
			NSLog(@"UITouchPhaseEnded");
			break;
		case UITouchPhaseCancelled:
			NSLog(@"UITouchPhaseCancelled");
			break;
		default:
			break;
	}
	[self setNeedsDisplay];
}