@@ -93,17 +93,21 @@ - (void)addKeyboardControl:(BOOL)panning actionHandler:(DAKeyboardDidMoveBlock)a
93
93
}
94
94
}
95
95
96
- - (CGPoint) keyboardOriginInView
96
+ - (CGRect) keyboardFrameInView
97
97
{
98
98
if (self.keyboardActiveView )
99
99
{
100
- CGPoint keyboardWindowOrigin = self.keyboardActiveView .frame .origin ;
101
- return [self convertPoint: keyboardWindowOrigin fromView: self .keyboardActiveView.window];
100
+ CGRect keyboardFrameInView = [self convertRect: self .keyboardActiveView.frame
101
+ fromView: self .keyboardActiveView.window];
102
+ return keyboardFrameInView;
102
103
}
103
104
else
104
105
{
105
- CGPoint keyboardWindowOrigin = CGPointMake (0 .0f , [[UIScreen mainScreen ] bounds ].size .height );
106
- return [self convertPoint: keyboardWindowOrigin fromView: self .keyboardActiveView.window];
106
+ CGRect keyboardFrameInView = CGRectMake (0 .0f ,
107
+ [[UIScreen mainScreen ] bounds ].size .height ,
108
+ 0 .0f ,
109
+ 0 .0f );
110
+ return keyboardFrameInView;
107
111
}
108
112
}
109
113
@@ -188,7 +192,7 @@ - (void)keyboardWillShow:(NSNotification *)notification
188
192
options: keyboardTransitionAnimationCurve
189
193
animations: ^{
190
194
if (self.keyboardDidMoveBlock )
191
- self.keyboardDidMoveBlock (keyboardEndFrameView. origin );
195
+ self.keyboardDidMoveBlock (keyboardEndFrameView);
192
196
}
193
197
completion: ^(BOOL finished){
194
198
}];
@@ -226,7 +230,7 @@ - (void)keyboardWillChangeFrame:(NSNotification *)notification
226
230
options: keyboardTransitionAnimationCurve
227
231
animations: ^{
228
232
if (self.keyboardDidMoveBlock )
229
- self.keyboardDidMoveBlock (keyboardEndFrameView. origin );
233
+ self.keyboardDidMoveBlock (keyboardEndFrameView);
230
234
}
231
235
completion: ^(BOOL finished){
232
236
}];
@@ -255,7 +259,7 @@ - (void)keyboardWillHide:(NSNotification *)notification
255
259
options: keyboardTransitionAnimationCurve
256
260
animations: ^{
257
261
if (self.keyboardDidMoveBlock )
258
- self.keyboardDidMoveBlock (keyboardEndFrameView. origin );
262
+ self.keyboardDidMoveBlock (keyboardEndFrameView);
259
263
}
260
264
completion: ^(BOOL finished){
261
265
}];
@@ -332,7 +336,7 @@ - (void)panGestureDidChange:(UIPanGestureRecognizer *)gesture
332
336
animations: ^{
333
337
[self .keyboardActiveView setFrame: newKeyboardViewFrame];
334
338
if (self.keyboardDidMoveBlock )
335
- self.keyboardDidMoveBlock (newKeyboardViewFrameInView. origin );
339
+ self.keyboardDidMoveBlock (newKeyboardViewFrameInView);
336
340
}
337
341
completion: ^(BOOL finished){
338
342
}];
@@ -355,7 +359,7 @@ - (void)panGestureDidChange:(UIPanGestureRecognizer *)gesture
355
359
animations: ^{
356
360
[self .keyboardActiveView setFrame: newKeyboardViewFrame];
357
361
if (self.keyboardDidMoveBlock )
358
- self.keyboardDidMoveBlock (newKeyboardViewFrameInView. origin );
362
+ self.keyboardDidMoveBlock (newKeyboardViewFrameInView);
359
363
}
360
364
completion: ^(BOOL finished){
361
365
if (!within44Pixels)
@@ -383,7 +387,7 @@ - (void)panGestureDidChange:(UIPanGestureRecognizer *)gesture
383
387
animations: ^{
384
388
[self .keyboardActiveView setFrame: newKeyboardViewFrame];
385
389
if (self.keyboardDidMoveBlock )
386
- self.keyboardDidMoveBlock (newKeyboardViewFrameInView. origin );
390
+ self.keyboardDidMoveBlock (newKeyboardViewFrameInView);
387
391
}
388
392
completion: ^(BOOL finished){
389
393
if (!within44Pixels)
0 commit comments