Remove unused code

This commit is contained in:
Niels Andriesse 2019-11-18 14:32:35 +11:00
parent 87379327ed
commit d29202bfff
2 changed files with 3 additions and 15 deletions

View File

@ -1107,12 +1107,6 @@ const CGFloat kMaxTextViewHeight = 98;
[self.mentionCandidateSelectionView setPublicChatChannel:publicChat.channel];
}
self.mentionCandidateSelectionView.mentionCandidates = mentionCandidates;
// Add animation
// [UIView animateWithDuration:0.5f animations:^{
// self.mentionCandidateSelectionViewSizeConstraint.constant = 6 + MIN(mentionCandidates.count, 4) * 52;
// [self setNeedsLayout];
// [self layoutIfNeeded];
// }];
self.mentionCandidateSelectionViewSizeConstraint.constant = 6 + MIN(mentionCandidates.count, 4) * 52;
[self setNeedsLayout];
[self layoutIfNeeded];
@ -1121,12 +1115,6 @@ const CGFloat kMaxTextViewHeight = 98;
- (void)hideMentionCandidateSelectionView
{
// Add animation
// [UIView animateWithDuration:0.5f animations:^{
// self.mentionCandidateSelectionViewSizeConstraint.constant = 0;
// [self setNeedsLayout];
// [self layoutIfNeeded];
// }];
self.mentionCandidateSelectionViewSizeConstraint.constant = 0;
[self setNeedsLayout];
[self layoutIfNeeded];

View File

@ -3826,11 +3826,11 @@ typedef enum : NSUInteger {
NSUInteger lastCharacterIndex = newText.length - 1;
unichar lastCharacter = [newText characterAtIndex:lastCharacterIndex];
// Check if there is a whitespace before '@' or the '@' is the first character
unichar secondLastCharacter = ' ';
unichar secondToLastCharacter = ' ';
if (lastCharacterIndex > 0) {
secondLastCharacter = [newText characterAtIndex:lastCharacterIndex - 1];
secondToLastCharacter = [newText characterAtIndex:lastCharacterIndex - 1];
}
if (lastCharacter == '@' && [NSCharacterSet.whitespaceAndNewlineCharacterSet characterIsMember:secondLastCharacter]) {
if (lastCharacter == '@' && [NSCharacterSet.whitespaceAndNewlineCharacterSet characterIsMember:secondToLastCharacter]) {
NSArray<LKMention *> *mentionCandidates = [LKAPI getMentionCandidatesFor:@"" in:self.thread.uniqueId];
self.currentMentionStartIndex = (NSInteger)lastCharacterIndex;
[self.inputToolbar showMentionCandidateSelectionViewFor:mentionCandidates in:self.thread];