Question

Though 4.3 users of iOS devices are rare these days, do we need to check before we assign values to the various Appearance classes using MonoTouch 5.2.x or will the MonoTouch framework just gracefully ignore these settings?

Was it helpful?

Solution

MonoTouch (just like Objective-C) does not does version checking inside API. That would be very costly to do and, in many cases, it cannot be done reliably (e.g. a new PushSomething methods).

Even when it could be possible to ignore at runtime, e.g. types that conforms to UIAppearance protocol, the application might want to adjust itself differently if it's not supported (e.g. color choice). E.g.

if (UIDevice.CurrentDevice.CheckSystemVersion (5,0)) {
    UISlider.Appearance.BackgroundColor = UIColor.Black;
} else {
    // limited UI customization path
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top