From 83d3f17d44be1eb03fdf17b5a7f9587209f9e640 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 2 Jul 2018 23:10:50 -0600 Subject: [PATCH] remove unused code, add comment --- .../ConversationView/ConversationInputTextView.m | 4 ++++ .../ConversationView/ConversationInputToolbar.m | 2 -- .../attachments/AttachmentApprovalViewController.swift | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m b/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m index e47550e9d..78b673148 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m @@ -72,6 +72,10 @@ NS_ASSUME_NONNULL_BEGIN - (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)isAnimated { + // When creating new lines, contentOffset is animated, but because because + // we are simultaneously resizing the text view, this can cause the + // text in the textview to be "too high" in the text view. + // Solution is to disable animation for setting content offset. [super setContentOffset:contentOffset animated:false]; } diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index 39af63b52..fbead8242 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -36,8 +36,6 @@ const CGFloat kMaxTextViewHeight = 98; @property (nonatomic, readonly) UIButton *sendButton; @property (nonatomic, readonly) UIButton *voiceMemoButton; -@property (nonatomic) NSValue *lastTextContentSize; -@property (nonatomic) CGFloat toolbarHeight; @property (nonatomic) CGFloat textViewHeight; @property (nonatomic, readonly) NSLayoutConstraint *textViewHeightConstraint; diff --git a/SignalMessaging/attachments/AttachmentApprovalViewController.swift b/SignalMessaging/attachments/AttachmentApprovalViewController.swift index 421fe4226..d0a0d5752 100644 --- a/SignalMessaging/attachments/AttachmentApprovalViewController.swift +++ b/SignalMessaging/attachments/AttachmentApprovalViewController.swift @@ -537,7 +537,7 @@ class CaptioningToolbar: UIView, UITextViewDelegate { textView.addBorder(with: UIColor.lightGray) textView.font = UIFont.ows_dynamicTypeBody textView.returnKeyType = .done - textView.textContainerInset = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: ) + textView.textContainerInset = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: 7) textView.scrollIndicatorInsets = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 3) let sendTitle = NSLocalizedString("ATTACHMENT_APPROVAL_SEND_BUTTON", comment: "Label for 'send' button in the 'attachment approval' dialog.")