Skip to content

Instantly share code, notes, and snippets.

@kamiyam
Created March 31, 2010 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamiyam/350001 to your computer and use it in GitHub Desktop.
Save kamiyam/350001 to your computer and use it in GitHub Desktop.
public override void TouchesBegan(NSSet touches, UIEvent evt)
{
var touch = touches.AnyObject as UITouch;
Console.Out.WriteLine("TouchesBegan:" + touch.TapCount);
if (touch.TapCount == 2)
{
Console.Out.WriteLine("TouchesBegan:SingleTap Cancel");
//シングルタップ時の処理キャンセル
}
}
public override void TouchesMoved(NSSet touches, UIEvent evt)
{
Console.Out.WriteLine("TouchesMoved");
}
public override void TouchesEnded(NSSet touches, UIEvent evt)
{
var touch = touches.AnyObject as UITouch;
Console.Out.WriteLine("TouchesEnded:" + touch.TapCount);
if (touch.TapCount == 1)
{
Console.Out.WriteLine("TouchesEnded:SingleTap");
this.PerformSelector(stAction, this, 5000);
}
else if ( touch.TapCount == 2 )
{
Console.Out.WriteLine("TouchesEnded:DoubleTap");
}
}
UIViewControllerを継承したサブクラスでTouchイベントをOverRide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment