Fixes for input toolbar.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent 2895da5042
commit 3fa2f22beb

@ -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…
Cancel
Save