diff --git a/MVMCoreUI/BaseClasses/CollectionViewCell.swift b/MVMCoreUI/BaseClasses/CollectionViewCell.swift index fb5b1a5e..e7bb7893 100644 --- a/MVMCoreUI/BaseClasses/CollectionViewCell.swift +++ b/MVMCoreUI/BaseClasses/CollectionViewCell.swift @@ -45,9 +45,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo open func updateView(_ size: CGFloat) { containerHelper.updateViewMargins(contentView, model: model, size: size) - DispatchQueue.main.async { - print("leading \(self.contentView.directionalLayoutMargins.leading)") - } + (molecule as? MVMCoreViewProtocol)?.updateView(size) } open func reset() { diff --git a/MVMCoreUI/BaseControllers/ThreeLayerCollectionViewController.swift b/MVMCoreUI/BaseControllers/ThreeLayerCollectionViewController.swift index af9fce4c..bf5520b9 100644 --- a/MVMCoreUI/BaseControllers/ThreeLayerCollectionViewController.swift +++ b/MVMCoreUI/BaseControllers/ThreeLayerCollectionViewController.swift @@ -8,9 +8,9 @@ import Foundation +/// A view controller that has three main layers, a header, collection rows, and a footer. The header is added as a supplement header to the first section, and the footer is added as a supplement footer to the last section. This view controller allows for flexible space between the three layers to fit the screeen. @objc open class ThreeLayerCollectionViewController: ProgrammaticCollectionViewController, UICollectionViewDelegateFlowLayout { - // The three main views private var topView: UIView? private var bottomView: UIView? private var headerView: ContainerCollectionReusableView? @@ -69,7 +69,7 @@ import Foundation } } - //MARK: - MFViewController + //MARK: - ViewController open override func updateViews() { super.updateViews() let width = view.bounds.width @@ -79,6 +79,11 @@ import Foundation if let bottomView = bottomView as? MVMCoreViewProtocol { bottomView.updateView(width) } + if let cells = collectionView?.visibleCells { + for cell in cells { + (cell as? MVMCoreViewProtocol)?.updateView(width) + } + } invalidateCollectionLayout() } @@ -106,7 +111,7 @@ import Foundation return nil } - /// can override to return a minimum fill space. + /// can override to return a minimum fill space. 0 default open func minimumFillSpace() -> CGFloat { return 0 }