Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
MonoTouch Generic UIGestureRecognizer
namespace FireHouse.UI.iOS
{
using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.ObjCRuntime;
public class Recognizer<T> : NSObject where T : UIGestureRecognizer, new()
{
T fRecognizer;
public T Instance {
get { return fRecognizer; }
}
Selector fSelector = new Selector("MyKit.Selector");
public Recognizer()
{
fRecognizer = new T();
fRecognizer.AddTarget(this, fSelector);
fRecognizer.Delegate = new RecognizerDelegate();
}
public event Action<T> OnRecognized;
[Export("MyKit.Selector")]
public void Recognized(UIGestureRecognizer recognizer)
{
if(OnRecognized != null)
OnRecognized(fRecognizer as T);
}
static bool isfalse = false;
}
public class RecognizerDelegate : UIGestureRecognizerDelegate
{
public override bool ShouldReceiveTouch(UIGestureRecognizer recognizer, UITouch touch)
{
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.