mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
655 B
Swift
21 lines
655 B
Swift
// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
import DifferenceKit
|
|
|
|
public protocol TableData {
|
|
associatedtype TableItem: Hashable & Differentiable
|
|
}
|
|
|
|
public protocol SectionedTableData: TableData {
|
|
associatedtype Section: SessionTableSection
|
|
|
|
typealias SectionModel = ArraySection<Section, SessionCell.Info<TableItem>>
|
|
}
|
|
|
|
public class TableDataState<Section: SessionTableSection, TableItem: Hashable & Differentiable>: SectionedTableData {
|
|
public private(set) var tableData: [SectionModel] = []
|
|
|
|
public func updateTableData(_ updatedData: [SectionModel]) { self.tableData = updatedData }
|
|
}
|