Merge branch 'mkirk/keyboard-hides-last-messages'

pull/1/head
Michael Kirk 8 years ago
commit 7c107a13ea

@ -3946,7 +3946,7 @@ typedef enum : NSUInteger {
[self presentViewController:controller animated:YES completion:nil]; [self presentViewController:controller animated:YES completion:nil];
} }
- (void)textViewDidChangeSize - (void)textViewDidChangePosition
{ {
OWSAssert([NSThread isMainThread]); OWSAssert([NSThread isMainThread]);

@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)didPasteAttachment:(SignalAttachment *_Nullable)attachment; - (void)didPasteAttachment:(SignalAttachment *_Nullable)attachment;
- (void)textViewDidChangeSize; - (void)textViewDidChangePosition;
@end @end

@ -14,6 +14,16 @@ NS_ASSUME_NONNULL_BEGIN
return YES; return YES;
} }
- (BOOL)becomeFirstResponder
{
BOOL becameFirstResponder = [super becomeFirstResponder];
if (becameFirstResponder) {
// Intercept to scroll to bottom when text view is tapped.
[self.textViewPasteDelegate textViewDidChangePosition];
}
return becameFirstResponder;
}
- (BOOL)pasteboardHasPossibleAttachment - (BOOL)pasteboardHasPossibleAttachment
{ {
// We don't want to load/convert images more than once so we // We don't want to load/convert images more than once so we
@ -51,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN
[super setFrame:frame]; [super setFrame:frame];
if (didChangeSize && isNonEmpty) { if (didChangeSize && isNonEmpty) {
[self.textViewPasteDelegate textViewDidChangeSize]; [self.textViewPasteDelegate textViewDidChangePosition];
} }
} }
@ -63,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN
[super setBounds:bounds]; [super setBounds:bounds];
if (didChangeSize && isNonEmpty) { if (didChangeSize && isNonEmpty) {
[self.textViewPasteDelegate textViewDidChangeSize]; [self.textViewPasteDelegate textViewDidChangePosition];
} }
} }

Loading…
Cancel
Save