Created
December 14, 2017 19:56
-
-
Save chamons/5b36f57c40bb05cd612ff2e3d2e5df86 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 NSGestureRecognizerPatch | |
{ | |
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")] | |
public extern static CGPoint CGPoint_objc_msgSend_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1); | |
static readonly IntPtr selLocationInView_Handle = ObjCRuntime.Selector.GetHandle ("locationInView:"); | |
public static CGPoint GetLocationInView (this NSGestureRecognizer self, NSView view) | |
{ | |
return CGPoint_objc_msgSend_IntPtr (self.Handle, selLocationInView_Handle, view == null ? IntPtr.Zero : view.Handle); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment