Rory McCrossan Rory McCrossan - 11 months ago 53
Objective-C Question

Equivalent of CGRectInfinite & CGRectIsInfinite in MonoTouch/Xamarin

I am trying to convert an open source flyout menu from Objective-C to Xamarin. The current issue I have is that the Obj-C code creates a frame using

. This does not appear to be available under MonoTouch, via the usual
class. Is there an alternative?

Similarly, there does not appear to be a
equivalent in
. What, if any, is the alternative?

Answer Source

Add this using statement first:

using MonoTouch.CoreGraphics;

Then you can test it with this:

public static RectangleF GetInfinite()
    var image = CIImage.EmptyImage;

    if (image.Extent.IsInfinite ())
        return image.Extent;

    throw new Exception ("Unable to create infinite rect");