Apply getter check to determine if API is exposed as property or as method for iOS backward compatibility

This commit is contained in:
Panayot Cankov
2016-09-12 12:54:38 +03:00
parent e9c7c5a749
commit b81c034f67
29 changed files with 174 additions and 113 deletions

View File

@@ -8,6 +8,8 @@ import style = require("ui/styling/style");
import font = require("ui/styling/font");
import view = require("ui/core/view");
import * as utils from "utils/utils";
global.moduleMerge(common, exports);
var color: typeof colorModule;
@@ -175,7 +177,7 @@ export class SegmentedBarStyler implements style.Styler {
else {
attrs = NSMutableDictionary.new();
}
let newFont = (<font.Font>newValue).getUIFont(UIFont.systemFontOfSize(UIFont.labelFontSize()));
let newFont = (<font.Font>newValue).getUIFont(UIFont.systemFontOfSize(utils.ios.getter(UIFont, UIFont.labelFontSize)));
attrs.setValueForKey(newFont, NSFontAttributeName);
bar.setTitleTextAttributesForState(attrs, UIControlState.Normal);
}
@@ -202,7 +204,7 @@ export class SegmentedBarStyler implements style.Styler {
currentFont = currentAttrs.objectForKey(NSFontAttributeName);
}
if (!currentFont) {
currentFont = UIFont.systemFontOfSize(UIFont.labelFontSize());
currentFont = UIFont.systemFontOfSize(utils.ios.getter(UIFont, UIFont.labelFontSize));
}
return currentFont;
}