Introduce a new SwiftUI TimelineView layer (wrapping the representable) to hold all the timeline specific bindings that are currently duplicated throughout the screens a timeline is used.

This commit is contained in:
Stefan Ceriu
2025-05-22 15:28:43 +03:00
committed by Stefan Ceriu
parent 4bcdf58e3b
commit d058e7cd25
5 changed files with 52 additions and 99 deletions
@@ -45,7 +45,7 @@ class TypingMembersObservableObject: ObservableObject {
/// extra keyboard handling magic that wasn't playing well with SwiftUI (as of iOS 16.1).
/// Also this TableViewController uses a **flipped tableview**
class TimelineTableViewController: UIViewController {
private let coordinator: TimelineView.Coordinator
private let coordinator: TimelineViewRepresentable.Coordinator
private let tableView = UITableView(frame: .zero, style: .plain)
var timelineItemsDictionary = OrderedDictionary<TimelineItemIdentifier.UniqueID, RoomTimelineItemViewState>() {
@@ -168,7 +168,7 @@ class TimelineTableViewController: UIViewController {
/// Whether or not the view has been shown on screen yet.
private var hasAppearedOnce = false
init(coordinator: TimelineView.Coordinator,
init(coordinator: TimelineViewRepresentable.Coordinator,
isScrolledToBottom: Binding<Bool>,
scrollToBottomPublisher: PassthroughSubject<Void, Never>) {
self.coordinator = coordinator