Created
November 30, 2017 22:56
-
-
Save chamons/9593ff269f382461fe5359b1266573cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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