WIP: date pills начало + memory: no MVP policy
This commit is contained in:
@@ -56,6 +56,11 @@ final class RosettaMessageListController: UIViewController {
|
|||||||
|
|
||||||
private let listView = RosettaListView(frame: .zero)
|
private let listView = RosettaListView(frame: .zero)
|
||||||
|
|
||||||
|
/// Floating date pill overlay (Telegram-style sticky date headers).
|
||||||
|
private let datePillOverlay = UIView()
|
||||||
|
private var datePillPool: [(container: UIView, label: UILabel)] = []
|
||||||
|
var topStickyOffset: CGFloat = 0
|
||||||
|
|
||||||
// MARK: - State
|
// MARK: - State
|
||||||
|
|
||||||
private var messages: [ChatMessage] = []
|
private var messages: [ChatMessage] = []
|
||||||
@@ -99,7 +104,20 @@ final class RosettaMessageListController: UIViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
listView.onScroll = { [weak self] _, _ in
|
listView.onScroll = { [weak self] _, _ in
|
||||||
// TODO: scroll-to-bottom button visibility
|
self?.updateFloatingDatePills()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Date pill overlay
|
||||||
|
datePillOverlay.frame = view.bounds
|
||||||
|
datePillOverlay.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
||||||
|
datePillOverlay.isUserInteractionEnabled = false
|
||||||
|
view.addSubview(datePillOverlay)
|
||||||
|
|
||||||
|
// Pre-create date pill pool (reuse like NativeMessageList)
|
||||||
|
for _ in 0..<5 {
|
||||||
|
let pill = makeDatePill()
|
||||||
|
datePillOverlay.addSubview(pill.container)
|
||||||
|
datePillPool.append(pill)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard tracking
|
// Keyboard tracking
|
||||||
|
|||||||
Reference in New Issue
Block a user