Closed DomGaud closed 7 years ago
Thanks @DomGaud , for now I will wait for {N} to fully support XCode8 before incorporating the fix in master.
After finding similar cases with other modules, I suggest using utils.ios.getter().
So something like this:
var application = utils.ios.getter(UIScreen, UIScreen.mainScreen)
var applicationFrame = application.applicationFrame
This checks if the property is a function and if it is, calls it on this. Designed to support backward compatibility for methods that became properties. Hence it works with both iOS10 and previous iOS versions. I have tested this using iOS8 as well.
Hey @DomGaud , thanks for the suggestion! I was already planning to change t that but this function is not yet available in the publicly released NPM modules. They are probably going to release it with 2.4 so that's when will update the DropDown.
I actually fixed it locally for me with the answer from @DomGaud and I'm on nativescript 2.3.
@PeterStaev the utility is in 2.3 👍 just hit this today. I've had to use it in a few plugins already.
var utils = require('utils/utils');
var screen = utils.ios.getter(UIScreen, UIScreen.mainScreen);
Thanks guys! Somehow when I initially looked at the definitions I was not seeing the getter()
function... New version is now on npm.
Thanks @PeterStaev
After updating to Nativescript 2.3.0 and Xcode 8, I get the following error:
TypeError: UIScreen.mainScreen is not a function. (In 'UIScreen.mainScreen()', 'UIScreen.mainScreen' is an instance of UIScreen)
Solution - change from using a method:
to a property