You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want my tableview handle multiple sections with different Items.
my model is :
struct Object: Hashable, Comparable, Equatable {
var index: Int
var name: String
var data: [Any]
}
and Object is section and data is row of cell
I went this way:
extension Object: Differentiable {
var differenceIdentifier: String {
return "\(index)"
}
func isContentEqual(to source: TypeStorableItem) -> Bool {
index == source.index && name == source.name
}
}
and in ViewController :
typealias AnyArraySection = ArraySection<TypeStorableItem, AnyDifferentiable>
var typeManager: [AnyArraySection] = []
var inputTypeManager: [AnyArraySection] {
get { typeManager }
set {
let changeset = StagedChangeset(source: typeManager, target: newValue)
self.tableView.reload(using: changeset, with: .automatic) { data in
self.typeManager = data
}
}
}
when I want add item
let model = Object(index: index,
name: identifier,
data: data)
item = ArraySection(model: model, elements: model.data)
how is it possible?
what about multiple sections with multiple types.
Detailed Description (Include Screenshots)
Environment
Library version:
Swift version:
iOS version:
13
Xcode version:
11.7
Devices/Simulators:
CocoaPods/Carthage version:
The text was updated successfully, but these errors were encountered:
J-Arji
changed the title
handel multi section
handle multiple sections
Sep 11, 2020
I want my tableview handle multiple sections with different Items.
my model is :
and
Object
is section anddata
is row of cellI went this way:
and in ViewController :
when I want add item
how is it possible?
what about multiple sections with multiple types.
Detailed Description (Include Screenshots)
Environment
Library version:
Swift version:
iOS version:
13
Xcode version:
11.7
Devices/Simulators:
CocoaPods/Carthage version:
The text was updated successfully, but these errors were encountered: