You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My suggestion is to check for iOS version and only use that attribute if version is 10+.
Something in the line of:
import * as platformModule from "tns-core-modules/platform";
var sdkVer= parseFloat(platformModule.device.sdkVersion);
if (sdkVer >= 10 ) {
titleLabel.adjustsFontForContentSizeCategory = true;
}
There's a simple issue that breaks compatibility with iOS prior to v10, due to the use of:
https://developer.apple.com/documentation/uikit/uicontentsizecategoryadjusting/1771731-adjustsfontforcontentsizecategor
which is iOS 10.0+ only.
My suggestion is to check for iOS version and only use that attribute if version is 10+.
Something in the line of:
or similar.
Nativescript mentions graceful degradation:
https://docs.nativescript.org/runtimes/ios/Requirements
but I could not find an elegant way to detect if a given attribute exists or not, instead of checking for the OS version.
Update:
The "more elegant" way may be using respondsToSelector :
Choosing one way or the other, may be a matter of performance.
The text was updated successfully, but these errors were encountered: