Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error TS2339: Property 'getter' does not exist on type 'typeof ios'. in Nativescript 6 with angular

Upgrade to latest version of Nativescript 6 from version 5 code start giving error of getter of ios in utils. Property 'getter' does not exist on type 'typeof ios'. in Nativescript 6 with angular. This code is responsible for close keyboard at IOS.

Checked over official Docs not method is available https://docs.nativescript.org/core-concepts/utils#ios

Also tried getting error after run by Object property access utils.ios.getter() is deprecated; use the respective native property instead utils.ios['getter'](UIApplication, UIApplication.sharedApplication)

utils.ios.getter(UIApplication, UIApplication.sharedApplication)
        .keyWindow
        .endEditing(true);

Getter should be available in ios utils

like image 517
acharyaks90 Avatar asked Dec 05 '22 09:12

acharyaks90


1 Answers

utils.ios.getter(...) was already deprecated on {N} v5.4, probably it's removed in v6. You should directly access the property moving forward.

UIApplication.sharedApplication.keyWindow.endEditing(true);
like image 146
Manoj Avatar answered Dec 28 '22 07:12

Manoj