acharyaks90
acharyaks90

Reputation: 83

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

Upvotes: 5

Views: 1638

Answers (1)

Manoj
Manoj

Reputation: 21908

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);

Upvotes: 16

Related Questions