fix(iOS): check for iOS 13 APIs (#8093)

This commit is contained in:
Vasil Chimev
2019-11-18 13:39:00 +02:00
committed by GitHub
parent d983f79923
commit b069ff38f3
12 changed files with 30 additions and 19 deletions

View File

@@ -153,7 +153,7 @@ export class TextBase extends TextBaseCommon {
this.nativeTextViewProtected.setAttributedTitleForState(attrText, UIControlState.Normal);
}
else {
if (majorVersion >= 13) {
if (majorVersion >= 13 && UIColor.labelColor) {
this.nativeTextViewProtected.textColor = UIColor.labelColor;
}
@@ -205,7 +205,7 @@ export class TextBase extends TextBaseCommon {
if (dict.size > 0 || isTextView) {
if (style.color) {
dict.set(NSForegroundColorAttributeName, style.color.ios);
} else if (majorVersion >= 13) {
} else if (majorVersion >= 13 && UIColor.labelColor) {
dict.set(NSForegroundColorAttributeName, UIColor.labelColor);
}
}