Some optimizations for TextBubbleView (#144)
This commit is contained in:
parent
592c8ee142
commit
d87fe40c90
|
|
@ -287,4 +287,24 @@ private final class ChatMessageTextView: UITextView {
|
|||
override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
override var selectedRange: NSRange {
|
||||
get {
|
||||
return NSRange(location: 0, length: 0)
|
||||
}
|
||||
set {
|
||||
// Part of the heaviest stack trace when scrolling (when updating text)
|
||||
// See https://github.com/badoo/Chatto/pull/144
|
||||
}
|
||||
}
|
||||
|
||||
override var contentOffset: CGPoint {
|
||||
get {
|
||||
return .zero
|
||||
}
|
||||
set {
|
||||
// Part of the heaviest stack trace when scrolling (when bounds are set)
|
||||
// See https://github.com/badoo/Chatto/pull/144
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,17 +146,17 @@ public class TextMessageCollectionViewCellDefaultStyle: TextMessageCollectionVie
|
|||
let tailKey = showsTail ? "tail" : "notail"
|
||||
let statusKey = self.statusKey(status)
|
||||
let highlightedKey = isSelected ? "highlighted" : "normal"
|
||||
let key = "\(directionKey)_\(tailKey)_\(statusKey)_\(highlightedKey)"
|
||||
let key = directionKey + "_" + tailKey + "_" + statusKey + "_" + highlightedKey
|
||||
return key
|
||||
}
|
||||
|
||||
private func templateKey(isIncoming isIncoming: Bool, showsTail: Bool) -> String {
|
||||
let directionKey = isIncoming ? "incoming" : "outgoing"
|
||||
let tailKey = showsTail ? "tail" : "notail"
|
||||
return "\(directionKey)_\(tailKey)"
|
||||
return directionKey + "_" + tailKey
|
||||
}
|
||||
|
||||
private func statusKey(status: MessageViewModelStatus) -> NSString {
|
||||
private func statusKey(status: MessageViewModelStatus) -> String {
|
||||
switch status {
|
||||
case .Success:
|
||||
return "ok"
|
||||
|
|
|
|||
Loading…
Reference in New Issue