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
let titleProvider = LabelProvider(text: "CollectionKit", font: .boldSystemFont(ofSize: 32))
let contentProvider = LabelProvider(text: "A modern swift framework for building reusable collection view components.", font: .boldSystemFont(ofSize: 28))
let buttonProvider = ButtonProvider(title: "Reload", sizeStrategy: (.fill, .absolute(50)), insert: UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0)) { _ in
let label = UILabel()
label.text = "change the text"
contentProvider.views.append(label)
}
...
let sections = [
waterfallProvider,
gridProvider,
wrapProvider
] as [Provider]
let composedHeaderProvider = ComposedHeaderProvider(
headerViewSource: { (view: UILabel, _, index) in
view.text = headers[index]
view.font = .boldSystemFont(ofSize: 21)
view.backgroundColor = .white
},
headerSizeSource: { _, _, size -> CGSize in
CGSize(width: size.width, height: 40)
},
sections: sections
)
composedHeaderProvider.isSticky = false
let composedProvider = ComposedProvider(
layout: FlowLayout(spacing: 10).inset(by: UIEdgeInsets(top: 0, left: 20, bottom: safeAreaBottom(), right: 20)),
sections: [
spaceProvider,
titleProvider,
contentProvider,
buttonProvider,
composedHeaderProvider
]
)
collectionView.provider = composedProvider
When I reload with contentProvider.views.append(label), the whole provider reload. Is that right? I need reload some widget like Flutter.
I had seen Note that if you assign an array to the dataSource and later update that array instead. It won't actually update the CollectionView in the Readme, but it's wrong with me.
The text was updated successfully, but these errors were encountered:
Some of my code:
When I reload with
contentProvider.views.append(label)
, the whole provider reload. Is that right? I need reload some widget like Flutter.I had seen
Note that if you assign an array to the dataSource and later update that array instead. It won't actually update the CollectionView
in the Readme, but it's wrong with me.The text was updated successfully, but these errors were encountered: