Forum Xamarin Xamarin.iOS

API Binding issue

JoeProJoePro CAUniversity ✭✭✭
edited April 2014 in Xamarin.iOS

I've been playing around with a native library and stumbled upon a couple weird things. The library in question is used to handle view animations and, as such, makes use of CGRectInfinite, CGRectIsInfinite, etc.

A quick google search allowed me to come across an extension method on RectangleF: RectangleFExtensions.IsInfinite(). Well, it doesn't seem to quite work. Turns out it calls out to the wrong method behind the scenes:

            ...
    [DllImport()]
    private static extern bool CGRectIsInfinite(RectangleF rect);

    [DllImport()]
    private static extern bool CGRectIsNull(RectangleF rect);

    public static bool IsInfinite(this RectangleF self) {
        return RectangleFExtensions.CGRectIsNull(self);
    }

    public static bool IsNull(this RectangleF self) {
        return RectangleFExtensions.CGRectIsNull(self);
    }
            ...

Alright, I guess I'll have to resort to using reflection in the mean time. I've googled around, searched on https://bugzilla.xamarin.com/ but couldn't find anything. Am I missing something here?

Second thing I noticed is that there's no way to create an infinite RectangleF. It's pretty easy to build by hand, I suppose, but a convenience method would be appreciated. Something along the lines of RectangleF.Empty?

Posts

Sign In or Register to comment.