public static void SetDimensions(this _View view, nfloat?width = null, nfloat?height = null) { if (nfloat.IsNaN(width ?? 0) || nfloat.IsNaN(height ?? 0)) { view.Log().ErrorFormat("A view Frame must not be set to [{0};{1}], overriding to [0;0]", width, height); width = 0; height = 0; } view.Frame = new CGRect(view.Frame.X, view.Frame.Y, width ?? view.Frame.Width, height ?? view.Frame.Height); }