Open ianterrell opened 7 years ago
The helper would have to be on the view controller though right? Not on the collection view
My intention in this ticket was to add helpers to the collection view, so that the implementation on the controller would be more straightforward.
So, not replacing the controller implementation, but simplifying it from:
func updateFonts(preferredContentSize: UIContentSizeCategory) {
guard let cells = collectionView?.visibleCells else { return }
for cell in cells {
guard let cell = cell as? RespondsToDynamicFont else { continue }
cell.updateFonts(preferredContentSize: preferredContentSize)
}
collectionView?.collectionViewLayout.invalidateLayout()
}
to
func updateFonts(preferredContentSize: UIContentSizeCategory) {
collectionView?.updateFonts(preferredContentSize: preferredContentSize)
collectionView?.collectionViewLayout.invalidateLayout()
}
Add a helper to update fonts on visible cells if the cells conform to
RespondsToDynamicFont
.