size toolbar WRT draft

This commit is contained in:
Michael Kirk 2018-08-30 13:18:03 -06:00
parent 17656a3aaa
commit 5d9cd86d13
3 changed files with 18 additions and 0 deletions

View File

@ -55,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Voice Memo
- (void)ensureTextViewHeight;
- (void)showVoiceMemoUI;
- (void)hideVoiceMemoUI:(BOOL)animated;

View File

@ -194,6 +194,11 @@ const CGFloat kMaxTextViewHeight = 98;
self.inputTextView.text = value;
[self ensureShouldShowVoiceMemoButtonAnimated:isAnimated];
[self ensureTextViewHeight];
}
- (void)ensureTextViewHeight
{
[self updateHeightWithTextView:self.inputTextView];
}

View File

@ -1209,6 +1209,18 @@ typedef enum : NSUInteger {
self.isUserScrolling = NO;
}
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
// We resize the inputToolbar whenever it's text is modified, including when setting saved draft-text.
// However it's possible this draft-text is set before the inputToolbar (an inputAccessoryView) is mounted
// in the view hierarchy. Since it's not in the view hierarchy, it hasn't been laid out and has no width,
// which is used to determine height.
// So here we unsure the proper height once we know everything's been layed out.
[self.inputToolbar ensureTextViewHeight];
}
#pragma mark - Initiliazers
- (void)updateNavigationTitle