Open hiddely opened 4 years ago
A slight improvement, though not the ideal solution: Both UICollectionView
and UITableView
expose func model<T>(at indexPath: IndexPath) throws -> T
So you could rewrite the top part to:
guard let item = try? collectionView.rx.model(at: indexPath) as YourModel else {
return .zero
}
Are there plans to support
UICollectionViewDelegateFlowLayout
in some reactive way, to respond to sizes based on the data model instead of only being able to rely on indexPath?Currently, I'm doing something like this:
However, this relies on some helper local variable
events
, which may or may not have been updated by an observable when the delegate is called.