Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static class NSGesturePatch
{
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
public static extern void void_objc_msgSend_Int64 (IntPtr receiver, IntPtr selector, long arg1);
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
public static extern void void_objc_msgSend_int (IntPtr receiver, IntPtr selector, int arg1);
public static void SetState (this NSGestureRecognizer t, NSGestureRecognizerState state)
{
if (IntPtr.Size == 8)
void_objc_msgSend_Int64(t.Handle, ObjCRuntime.Selector.GetHandle ("setState:"), (long) state);
else
void_objc_msgSend_int(t.Handle, ObjCRuntime.Selector.GetHandle ("setState:"), (int) state);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.