comments
This commit is contained in:
parent
4941c51be3
commit
ce8cc3d430
@ -914,6 +914,7 @@
|
|||||||
0A5D59C323AD488600EFD9E9 /* Protocols */ = {
|
0A5D59C323AD488600EFD9E9 /* Protocols */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
D21B7F72243BAC6800051ABF /* CollectionItemModelProtocol.swift */,
|
||||||
0A5D59C123AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift */,
|
0A5D59C123AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift */,
|
||||||
);
|
);
|
||||||
path = Protocols;
|
path = Protocols;
|
||||||
@ -1265,7 +1266,6 @@
|
|||||||
D260105E23D0BFFC00764D80 /* StackItem.swift */,
|
D260105E23D0BFFC00764D80 /* StackItem.swift */,
|
||||||
01EB368A23609801006832FA /* MoleculeStackItemModel.swift */,
|
01EB368A23609801006832FA /* MoleculeStackItemModel.swift */,
|
||||||
D2FB151C23A40F1500C20E10 /* MoleculeStackItem.swift */,
|
D2FB151C23A40F1500C20E10 /* MoleculeStackItem.swift */,
|
||||||
D21B7F72243BAC6800051ABF /* CollectionItemModelProtocol.swift */,
|
|
||||||
D21B7F76243BB70700051ABF /* MoleculeCollectionItemModel.swift */,
|
D21B7F76243BB70700051ABF /* MoleculeCollectionItemModel.swift */,
|
||||||
D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */,
|
D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */,
|
||||||
012A88C1238D7BCA00FE3DA1 /* CarouselItemModel.swift */,
|
012A88C1238D7BCA00FE3DA1 /* CarouselItemModel.swift */,
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
/// A model for a collection item that is a container for any molecule.
|
||||||
@objcMembers open class MoleculeCollectionItemModel: CollectionItemModelProtocol, ContainerModelProtocol, MoleculeModelProtocol {
|
@objcMembers open class MoleculeCollectionItemModel: CollectionItemModelProtocol, ContainerModelProtocol, MoleculeModelProtocol {
|
||||||
open class var identifier: String {
|
open class var identifier: String {
|
||||||
return "collectionItem"
|
return "collectionItem"
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
|
/// A collection item that is a container for any molecule.
|
||||||
open class MoleculeCollectionViewCell: CollectionViewCell {
|
open class MoleculeCollectionViewCell: CollectionViewCell {
|
||||||
|
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
|
|||||||
@ -18,6 +18,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo
|
|||||||
|
|
||||||
private var initialSetupPerformed = false
|
private var initialSetupPerformed = false
|
||||||
|
|
||||||
|
// MARK: - Inits
|
||||||
public override init(frame: CGRect) {
|
public override init(frame: CGRect) {
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
initialSetup()
|
initialSetup()
|
||||||
@ -35,6 +36,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - MVMCoreViewProtocol
|
||||||
open func setupView() {
|
open func setupView() {
|
||||||
isAccessibilityElement = false
|
isAccessibilityElement = false
|
||||||
contentView.isAccessibilityElement = false
|
contentView.isAccessibilityElement = false
|
||||||
@ -56,6 +58,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo
|
|||||||
backgroundColor = .white
|
backgroundColor = .white
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - MoleculeViewProtocol
|
||||||
open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
guard let model = model as? CollectionItemModelProtocol else { return }
|
guard let model = model as? CollectionItemModelProtocol else { return }
|
||||||
self.model = model
|
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) {
|
open func addMolecule(_ molecule: MoleculeViewProtocol) {
|
||||||
contentView.addSubview(molecule)
|
contentView.addSubview(molecule)
|
||||||
containerHelper.constrainView(molecule)
|
containerHelper.constrainView(molecule)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user