Merge branch 'charlesmchen/inputToolbarFixes'
This commit is contained in:
commit
1237d762e7
@ -12,7 +12,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (nonatomic) UILabel *placeholderView;
|
||||
@property (nonatomic) NSArray<NSLayoutConstraint *> *placeholderConstraints;
|
||||
@property (nonatomic) BOOL isEditing;
|
||||
|
||||
@end
|
||||
|
||||
@ -119,7 +118,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)updatePlaceholderVisibility
|
||||
{
|
||||
self.placeholderView.hidden = self.text.length > 0 || self.isEditing;
|
||||
self.placeholderView.hidden = self.text.length > 0;
|
||||
}
|
||||
|
||||
- (void)setText:(NSString *_Nullable)text
|
||||
@ -129,13 +128,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
[self updatePlaceholderVisibility];
|
||||
}
|
||||
|
||||
- (void)setIsEditing:(BOOL)isEditing
|
||||
{
|
||||
_isEditing = isEditing;
|
||||
|
||||
[self updatePlaceholderVisibility];
|
||||
}
|
||||
|
||||
- (BOOL)canBecomeFirstResponder
|
||||
{
|
||||
return YES;
|
||||
@ -193,8 +185,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
// TODO: Is this necessary?
|
||||
|
||||
[textView becomeFirstResponder];
|
||||
|
||||
self.isEditing = YES;
|
||||
}
|
||||
|
||||
- (void)textViewDidChange:(UITextView *)textView
|
||||
@ -209,8 +199,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)textViewDidEndEditing:(UITextView *)textView
|
||||
{
|
||||
[textView resignFirstResponder];
|
||||
|
||||
self.isEditing = NO;
|
||||
}
|
||||
|
||||
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
|
||||
|
||||
@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol ConversationInputTextViewDelegate;
|
||||
|
||||
@interface ConversationInputToolbar : UIToolbar
|
||||
@interface ConversationInputToolbar : UIView
|
||||
|
||||
@property (nonatomic, weak) id<ConversationInputToolbarDelegate> inputToolbarDelegate;
|
||||
|
||||
|
||||
@ -72,12 +72,7 @@ static void *kConversationInputTextViewObservingContext = &kConversationInputTex
|
||||
{
|
||||
self.layoutMargins = UIEdgeInsetsZero;
|
||||
|
||||
// TODO: I think there's an easier to get the right appearance,
|
||||
// but I can't figure it out.
|
||||
UIView *backgroundView = [UIView new];
|
||||
backgroundView.backgroundColor = [UIColor colorWithWhite:249 / 255.f alpha:1.f];
|
||||
[self addSubview:backgroundView];
|
||||
[backgroundView autoPinEdgesToSuperviewEdges];
|
||||
self.backgroundColor = [UIColor colorWithWhite:249 / 255.f alpha:1.f];
|
||||
|
||||
_contentView = [UIView containerView];
|
||||
[self addSubview:self.contentView];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user