Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Stable Release of XS with Support iOS Compiler Warning Bug

$
0
0

Before the stable release this chunk of code used to compile fine:

    /// <summary>
    /// Returns the bounds for the device's <c>MainScreen</c> adjusted to fit the current <c>UIInterfaceOrientation</c>
    /// </summary>
    /// <value>The rotated screen bounds.</value>
    internal static RectangleF RotatedScreenBounds{
        get {
            RectangleF bounds;

            //Adjust view to match current interface orientation
            switch (currentDeviceOrientation) {
            case UIInterfaceOrientation.LandscapeLeft:
            case UIInterfaceOrientation.LandscapeRight:
                bounds = new RectangleF (0, 0, UIScreen.MainScreen.Bounds.Height, UIScreen.MainScreen.Bounds.Width);
                break;
            case UIInterfaceOrientation.Portrait:
            case UIInterfaceOrientation.PortraitUpsideDown:
                bounds = new RectangleF (0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);
                break;
            }

            //Return results
            return bounds;
        }
    }

Now I get an error at return bounds; that say Use of unassigned local variable 'bounds' even though all paths through the case statement set a value to bounds.

Note that this code worked correctly before.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>