Minor refactoring
This commit is contained in:
parent
09de88a14f
commit
f0b74c31fa
|
@ -295,7 +295,7 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
|
||||||
if !newText.isEmpty {
|
if !newText.isEmpty {
|
||||||
let lastCharacterIndex = newText.index(before: newText.endIndex)
|
let lastCharacterIndex = newText.index(before: newText.endIndex)
|
||||||
let lastCharacter = newText[lastCharacterIndex]
|
let lastCharacter = newText[lastCharacterIndex]
|
||||||
// Check if there is a whitespace before the '@' or the '@' is the first character
|
// Check if there is whitespace before the '@' or the '@' is the first character
|
||||||
let isCharacterBeforeLastWhiteSpaceOrStartOfLine: Bool
|
let isCharacterBeforeLastWhiteSpaceOrStartOfLine: Bool
|
||||||
if newText.count == 1 {
|
if newText.count == 1 {
|
||||||
isCharacterBeforeLastWhiteSpaceOrStartOfLine = true // Start of line
|
isCharacterBeforeLastWhiteSpaceOrStartOfLine = true // Start of line
|
||||||
|
|
|
@ -472,7 +472,11 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate {
|
||||||
let sign: CGFloat = -1
|
let sign: CGFloat = -1
|
||||||
let x = (damping * (sqrt(abs(translationX)) / sqrt(damping))) * sign
|
let x = (damping * (sqrt(abs(translationX)) / sqrt(damping))) * sign
|
||||||
viewsToMove.forEach { $0.transform = CGAffineTransform(translationX: x, y: 0) }
|
viewsToMove.forEach { $0.transform = CGAffineTransform(translationX: x, y: 0) }
|
||||||
replyButton.alpha = abs(translationX) / VisibleMessageCell.maxBubbleTranslationX
|
if timerView.isHidden {
|
||||||
|
replyButton.alpha = abs(translationX) / VisibleMessageCell.maxBubbleTranslationX
|
||||||
|
} else {
|
||||||
|
replyButton.alpha = 0 // Always hide the reply button if the timer view is showing, otherwise they can overlap
|
||||||
|
}
|
||||||
if abs(translationX) > VisibleMessageCell.swipeToReplyThreshold && abs(previousX) < VisibleMessageCell.swipeToReplyThreshold {
|
if abs(translationX) > VisibleMessageCell.swipeToReplyThreshold && abs(previousX) < VisibleMessageCell.swipeToReplyThreshold {
|
||||||
UIImpactFeedbackGenerator(style: .heavy).impactOccurred() // Let the user know when they've hit the swipe to reply threshold
|
UIImpactFeedbackGenerator(style: .heavy).impactOccurred() // Let the user know when they've hit the swipe to reply threshold
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ final class ScrollToBottomButton : UIView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol ScrollToBottomButtonDelegate : class {
|
protocol ScrollToBottomButtonDelegate : class {
|
||||||
|
|
||||||
func handleScrollToBottomButtonTapped()
|
func handleScrollToBottomButtonTapped()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue