11#import " IonicKeyboard.h"
2- #import " UIWebViewExtension.h"
2+ // #import "UIWebViewExtension.h"
33#import < Cordova/CDVAvailability.h>
44
55@implementation IonicKeyboard
66
7- @synthesize hideKeyboardAccessoryBar = _hideKeyboardAccessoryBar;
7+ // @synthesize hideKeyboardAccessoryBar = _hideKeyboardAccessoryBar;
88@synthesize disableScroll = _disableScroll;
99// @synthesize styleDark = _styleDark;
1010
1111- (void )pluginInitialize {
12-
12+
1313 NSNotificationCenter * nc = [NSNotificationCenter defaultCenter ];
1414 __weak IonicKeyboard* weakSelf = self;
1515
1616 // set defaults
17- self.hideKeyboardAccessoryBar = YES ;
17+ // self.hideKeyboardAccessoryBar = YES;
1818 self.disableScroll = NO ;
1919 // self.styleDark = NO;
20-
20+
2121 _keyboardShowObserver = [nc addObserverForName: UIKeyboardWillShowNotification
2222 object: nil
2323 queue: [NSOperationQueue mainQueue ]
2424 usingBlock: ^(NSNotification * notification) {
25-
25+
2626 CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue ];
2727 keyboardFrame = [self .viewController.view convertRect: keyboardFrame fromView: nil ];
28-
28+
2929 [weakSelf.commandDelegate evalJs: [NSString stringWithFormat: @" cordova.plugins.Keyboard.isVisible = true; cordova.fireWindowEvent('native.keyboardshow', { 'keyboardHeight': %@ }); " , [@(keyboardFrame.size.height) stringValue ]]];
3030
3131 // deprecated
3232 [weakSelf.commandDelegate evalJs: [NSString stringWithFormat: @" cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight': %@ }); " , [@(keyboardFrame.size.height) stringValue ]]];
3333 }];
34-
34+
3535 _keyboardHideObserver = [nc addObserverForName: UIKeyboardWillHideNotification
3636 object: nil
3737 queue: [NSOperationQueue mainQueue ]
@@ -63,23 +63,23 @@ - (void)setDisableScroll:(BOOL)disableScroll {
6363}
6464
6565
66- - (BOOL )hideKeyboardAccessoryBar {
67- return _hideKeyboardAccessoryBar;
68- }
69-
70- - (void )setHideKeyboardAccessoryBar : (BOOL )hideKeyboardAccessoryBar {
71- if (hideKeyboardAccessoryBar == _hideKeyboardAccessoryBar || ![self .webView isKindOfClass: [UIWebView class ]]) {
72- return ;
73- }
74- if (hideKeyboardAccessoryBar) {
75- ((UIWebView*)self.webView ).hackishlyHidesInputAccessoryView = YES ;
76- }
77- else {
78- ((UIWebView*)self.webView ).hackishlyHidesInputAccessoryView = NO ;
79- }
80-
81- _hideKeyboardAccessoryBar = hideKeyboardAccessoryBar;
82- }
66+ // - (BOOL)hideKeyboardAccessoryBar {
67+ // return _hideKeyboardAccessoryBar;
68+ // }
69+ //
70+ // - (void)setHideKeyboardAccessoryBar:(BOOL)hideKeyboardAccessoryBar {
71+ // if (hideKeyboardAccessoryBar == _hideKeyboardAccessoryBar || ![self.webView isKindOfClass:[UIWebView class]]) {
72+ // return;
73+ // }
74+ // if (hideKeyboardAccessoryBar) {
75+ // ((UIWebView*)self.webView).hackishlyHidesInputAccessoryView = YES;
76+ // }
77+ // else {
78+ // ((UIWebView*)self.webView).hackishlyHidesInputAccessoryView = NO;
79+ // }
80+ //
81+ // _hideKeyboardAccessoryBar = hideKeyboardAccessoryBar;
82+ // }
8383
8484/*
8585- (BOOL)styleDark {
@@ -129,15 +129,15 @@ - (void) disableScroll:(CDVInvokedUrlCommand*)command {
129129 }
130130}
131131
132- - (void ) hideKeyboardAccessoryBar : (CDVInvokedUrlCommand*)command {
133- if (!command.arguments || ![command.arguments count ]){
134- return ;
135- }
136- id value = [command.arguments objectAtIndex: 0 ];
137- if (value != [NSNull null ]) {
138- self.hideKeyboardAccessoryBar = [value boolValue ];
139- }
140- }
132+ // - (void) hideKeyboardAccessoryBar:(CDVInvokedUrlCommand*)command {
133+ // if (!command.arguments || ![command.arguments count]){
134+ // return;
135+ // }
136+ // id value = [command.arguments objectAtIndex:0];
137+ // if (value != [NSNull null]) {
138+ // self.hideKeyboardAccessoryBar = [value boolValue];
139+ // }
140+ // }
141141
142142- (void ) close : (CDVInvokedUrlCommand*)command {
143143 [self .webView endEditing: YES ];
@@ -153,7 +153,7 @@ - (void) styleDark:(CDVInvokedUrlCommand*)command {
153153 return;
154154 }
155155 id value = [command.arguments objectAtIndex:0];
156-
156+
157157 self.styleDark = [value boolValue];
158158}
159159*/
0 commit comments