minor cleaning
This commit is contained in:
parent
c3e4786d5b
commit
72fa1fe9cd
@ -221,8 +221,8 @@
|
||||
BB2C968F24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */; };
|
||||
BB2C969224330F73006FF80C /* ListRightVariableTextLinkAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2C969124330F73006FF80C /* ListRightVariableTextLinkAllTextAndLinks.swift */; };
|
||||
BB2FB3BB247E7EBC00DF73CD /* TagCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2FB3BA247E7EBC00DF73CD /* TagCollectionViewCell.swift */; };
|
||||
BB2FB3BD247E7EF200DF73CD /* TagsList.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2FB3BC247E7EF200DF73CD /* TagsList.swift */; };
|
||||
BB2FB3BF247E7F0900DF73CD /* TagsListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2FB3BE247E7F0900DF73CD /* TagsListModel.swift */; };
|
||||
BB2FB3BD247E7EF200DF73CD /* Tags.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2FB3BC247E7EF200DF73CD /* Tags.swift */; };
|
||||
BB2FB3BF247E7F0900DF73CD /* TagsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2FB3BE247E7F0900DF73CD /* TagsModel.swift */; };
|
||||
BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; };
|
||||
BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; };
|
||||
BB54C5202434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB54C51E2434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift */; };
|
||||
@ -664,8 +664,8 @@
|
||||
BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListRightVariableTextLinkAllTextAndLinksModel.swift; sourceTree = "<group>"; };
|
||||
BB2C969124330F73006FF80C /* ListRightVariableTextLinkAllTextAndLinks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListRightVariableTextLinkAllTextAndLinks.swift; sourceTree = "<group>"; };
|
||||
BB2FB3BA247E7EBC00DF73CD /* TagCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagCollectionViewCell.swift; sourceTree = "<group>"; };
|
||||
BB2FB3BC247E7EF200DF73CD /* TagsList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagsList.swift; sourceTree = "<group>"; };
|
||||
BB2FB3BE247E7F0900DF73CD /* TagsListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagsListModel.swift; sourceTree = "<group>"; };
|
||||
BB2FB3BC247E7EF200DF73CD /* Tags.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tags.swift; sourceTree = "<group>"; };
|
||||
BB2FB3BE247E7F0900DF73CD /* TagsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagsModel.swift; sourceTree = "<group>"; };
|
||||
BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = "<group>"; };
|
||||
BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = "<group>"; };
|
||||
BB54C51E2434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListRightVariableButtonAllTextAndLinks.swift; sourceTree = "<group>"; };
|
||||
@ -1456,12 +1456,6 @@
|
||||
D264FAA8243FE17A00D98315 /* Selectors */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BB2FB3BE247E7F0900DF73CD /* TagsListModel.swift */,
|
||||
BB2FB3BC247E7EF200DF73CD /* TagsList.swift */,
|
||||
BB258D36248A259000125E9D /* UICollectionViewLeftAlignedLayout.swift */,
|
||||
BBC0C4FE24811DCA0087C44F /* TagModel.swift */,
|
||||
BBC0C4FC24811DBC0087C44F /* Tag.swift */,
|
||||
BB2FB3BA247E7EBC00DF73CD /* TagCollectionViewCell.swift */,
|
||||
D264FAAB2441009400D98315 /* RadioBoxCollectionViewCell.swift */,
|
||||
BBAA4F01243D8E3B005AAD5F /* RadioBoxesModel.swift */,
|
||||
BBAA4EFF243D8E3B005AAD5F /* RadioBoxes.swift */,
|
||||
@ -1561,8 +1555,8 @@
|
||||
D29DF10D21E67A70003B2FB9 /* Atoms */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2BEFEF5248A954C00FAB3A9 /* FormFields */,
|
||||
D264FAA8243FE17A00D98315 /* Selectors */,
|
||||
D29DF22B21E6A0FA003B2FB9 /* TextFields */,
|
||||
D29DF17D21E69E26003B2FB9 /* Views */,
|
||||
D29DF16821E69E1F003B2FB9 /* Buttons */,
|
||||
);
|
||||
@ -1875,6 +1869,7 @@
|
||||
D20923582450ECE00044AD09 /* TableView.swift */,
|
||||
D2755D7A23689C7500485468 /* TableViewCell.swift */,
|
||||
D21B7F70243BAC1600051ABF /* CollectionViewCell.swift */,
|
||||
BB258D36248A259000125E9D /* UICollectionViewLeftAlignedLayout.swift */,
|
||||
D264FAA92440F97600D98315 /* CollectionView.swift */,
|
||||
0A5D59C323AD488600EFD9E9 /* Protocols */,
|
||||
0A7918F423F5E7EA00772FF4 /* ImageView.swift */,
|
||||
@ -1883,6 +1878,27 @@
|
||||
path = BaseClasses;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2BEFEF5248A954C00FAB3A9 /* FormFields */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2BEFEF6248A957A00FAB3A9 /* Tags */,
|
||||
D29DF22B21E6A0FA003B2FB9 /* TextFields */,
|
||||
);
|
||||
path = FormFields;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2BEFEF6248A957A00FAB3A9 /* Tags */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BBC0C4FE24811DCA0087C44F /* TagModel.swift */,
|
||||
BBC0C4FC24811DBC0087C44F /* Tag.swift */,
|
||||
BB2FB3BE247E7F0900DF73CD /* TagsModel.swift */,
|
||||
BB2FB3BC247E7EF200DF73CD /* Tags.swift */,
|
||||
BB2FB3BA247E7EBC00DF73CD /* TagCollectionViewCell.swift */,
|
||||
);
|
||||
path = Tags;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2C78CD324252F4E00B69FDE /* Atomic */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -2154,7 +2170,7 @@
|
||||
D2755D7B23689C7500485468 /* TableViewCell.swift in Sources */,
|
||||
0A25209624645AFD000FA9F6 /* TextViewEntryField.swift in Sources */,
|
||||
014AA72623C501E2006F3E93 /* ContainerModelProtocol.swift in Sources */,
|
||||
BB2FB3BF247E7F0900DF73CD /* TagsListModel.swift in Sources */,
|
||||
BB2FB3BF247E7F0900DF73CD /* TagsModel.swift in Sources */,
|
||||
AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */,
|
||||
011D9626240EBB16000E3791 /* RadioButtonLabelModel.swift in Sources */,
|
||||
8DDD6C1D244D90B8006A2232 /* ListThreeColumnDataUsage.swift in Sources */,
|
||||
@ -2292,7 +2308,7 @@
|
||||
D253BB9E2458751F002DE544 /* BGImageMoleculeModel.swift in Sources */,
|
||||
0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */,
|
||||
8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */,
|
||||
BB2FB3BD247E7EF200DF73CD /* TagsList.swift in Sources */,
|
||||
BB2FB3BD247E7EF200DF73CD /* Tags.swift in Sources */,
|
||||
BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */,
|
||||
D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */,
|
||||
525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */,
|
||||
|
||||
@ -32,4 +32,10 @@ import Foundation
|
||||
super.updateView(size)
|
||||
label.updateView(size)
|
||||
}
|
||||
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
label.reset()
|
||||
label.styleRegularBodySmall(true)
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// TagsList.swift
|
||||
// Tags.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Dhamodaram Nandi on 27/05/20.
|
||||
@ -8,12 +8,11 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
open class TagsList: View,MFButtonProtocol {
|
||||
|
||||
open class Tags: View, MFButtonProtocol {
|
||||
public var collectionView: CollectionView!
|
||||
public var collectionViewHeight: NSLayoutConstraint!
|
||||
private var tagsListModel: TagsListModel? {
|
||||
return model as? TagsListModel
|
||||
private var tagsListModel: TagsModel? {
|
||||
return model as? TagsModel
|
||||
}
|
||||
|
||||
private var delegateObject: MVMCoreUIDelegateObject?
|
||||
@ -27,7 +26,6 @@ open class TagsList: View,MFButtonProtocol {
|
||||
DispatchQueue.main.async {
|
||||
self.collectionView.collectionViewLayout.invalidateLayout()
|
||||
self.collectionViewHeight.constant = self.collectionView.contentSize.height
|
||||
self.collectionViewHeight.isActive = true
|
||||
self.delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
|
||||
}
|
||||
}
|
||||
@ -46,7 +44,7 @@ open class TagsList: View,MFButtonProtocol {
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
self.delegateObject = delegateObject
|
||||
guard let tagsListModel = model as? TagsListModel else { return }
|
||||
guard let tagsListModel = model as? TagsModel else { return }
|
||||
tags = tagsListModel.tags
|
||||
registerCells()
|
||||
collectionView.reloadData()
|
||||
@ -61,7 +59,6 @@ open class TagsList: View,MFButtonProtocol {
|
||||
/// Creates the layout for the collection.
|
||||
open func createCollectionViewLayout() -> UICollectionViewLayout {
|
||||
let layout = UICollectionViewLeftAlignedLayout()
|
||||
layout.scrollDirection = .vertical
|
||||
layout.estimatedItemSize = CGSize(width: 140, height: 40)
|
||||
layout.minimumLineSpacing = 24.0
|
||||
return layout
|
||||
@ -81,7 +78,7 @@ open class TagsList: View,MFButtonProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
extension TagsList: UICollectionViewDataSource {
|
||||
extension Tags: UICollectionViewDataSource {
|
||||
open func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return tags?.count ?? 0
|
||||
}
|
||||
@ -98,9 +95,10 @@ extension TagsList: UICollectionViewDataSource {
|
||||
}
|
||||
}
|
||||
|
||||
extension TagsList: UICollectionViewDelegate {
|
||||
extension Tags: UICollectionViewDelegate {
|
||||
open func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
guard let tagModel = tags?[indexPath.row], let tagAction = tagModel.action else {return}
|
||||
guard let tagModel = tags?[indexPath.row],
|
||||
let tagAction = tagModel.action else { return }
|
||||
Button.performButtonAction(with: tagAction, button: self, delegateObject: delegateObject, additionalData: nil)
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// TagsListModel.swift
|
||||
// TagsModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Dhamodaram Nandi on 27/05/20.
|
||||
@ -8,17 +8,15 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class TagsListModel: MoleculeModelProtocol {
|
||||
|
||||
@objcMembers public class TagsModel: MoleculeModelProtocol {
|
||||
public static var identifier: String = "tags"
|
||||
public var backgroundColor: Color?
|
||||
public static var identifier: String = "tagsList"
|
||||
public var tags: [TagModel]
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case backgroundColor
|
||||
case tags
|
||||
case height
|
||||
}
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
@ -73,7 +73,7 @@ import Foundation
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: RadioBoxes.self, viewModelClass: RadioBoxesModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: Checkbox.self, viewModelClass: CheckboxModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: RadioSwatches.self, viewModelClass: RadioSwatchesModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: TagsList.self, viewModelClass: TagsListModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: Tags.self, viewModelClass: TagsModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: Tag.self, viewModelClass: TagModel.self)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user