Open jessesquires opened 4 years ago
Actually, macOS might need all of its own infra to make this work... I'm not sure how much we can reuse.
Especially with the new design here that uses associatedType
s for CellViewModel
, etc.
But, "cells" on macOS are actually NSViewController
s, which is... weird.
https://developer.apple.com/documentation/appkit/nscollectionviewitem
Maybe something like this:
public protocol CellViewModel: DiffableViewModel, ViewRegistrationProvider {
#if os(iOS)
associatedtype CellType: UICollectionViewCell
#elseif os(macOS)
associatedtype CellType: NSCollectionViewItem
#endif
// ....
}
However... I think this could get ugly very quickly.
In any case, this is a significant undertaking.
⚠️ This is a very large task. Please coordinate here before doing any work.
ℹ️ I don't have a need for this yet, but might in the future.
ToDo
Here's a rough, high-level outline of what needs to be done.
NSCollectionView
infra andUICollectionView
infraResources