This commit is contained in:
Pfeil, Scott Robert 2020-04-08 16:51:30 -04:00
parent 4941c51be3
commit ce8cc3d430
5 changed files with 7 additions and 3 deletions

View File

@ -914,6 +914,7 @@
0A5D59C323AD488600EFD9E9 /* Protocols */ = {
isa = PBXGroup;
children = (
D21B7F72243BAC6800051ABF /* CollectionItemModelProtocol.swift */,
0A5D59C123AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift */,
);
path = Protocols;
@ -1265,7 +1266,6 @@
D260105E23D0BFFC00764D80 /* StackItem.swift */,
01EB368A23609801006832FA /* MoleculeStackItemModel.swift */,
D2FB151C23A40F1500C20E10 /* MoleculeStackItem.swift */,
D21B7F72243BAC6800051ABF /* CollectionItemModelProtocol.swift */,
D21B7F76243BB70700051ABF /* MoleculeCollectionItemModel.swift */,
D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */,
012A88C1238D7BCA00FE3DA1 /* CarouselItemModel.swift */,

View File

@ -8,7 +8,7 @@
import Foundation
/// A model for a collection item that is a container for any molecule.
@objcMembers open class MoleculeCollectionItemModel: CollectionItemModelProtocol, ContainerModelProtocol, MoleculeModelProtocol {
open class var identifier: String {
return "collectionItem"

View File

@ -8,6 +8,7 @@
import UIKit
/// A collection item that is a container for any molecule.
open class MoleculeCollectionViewCell: CollectionViewCell {
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {

View File

@ -18,6 +18,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo
private var initialSetupPerformed = false
// MARK: - Inits
public override init(frame: CGRect) {
super.init(frame: .zero)
initialSetup()
@ -35,6 +36,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo
}
}
// MARK: - MVMCoreViewProtocol
open func setupView() {
isAccessibilityElement = false
contentView.isAccessibilityElement = false
@ -56,6 +58,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo
backgroundColor = .white
}
// MARK: - MoleculeViewProtocol
open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let model = model as? CollectionItemModelProtocol else { return }
self.model = model
@ -71,7 +74,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo
}
}
/// Convenience function. Adds the molecule to the view.
/// Convenience function. Adds a molecule to the view.
open func addMolecule(_ molecule: MoleculeViewProtocol) {
contentView.addSubview(molecule)
containerHelper.constrainView(molecule)