Merge branch 'feature/entry_fields_models' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/entry_fields_models
This commit is contained in:
commit
86e6a0aba7
@ -40,7 +40,9 @@ import UIKit
|
|||||||
for moleculeList in molecules {
|
for moleculeList in molecules {
|
||||||
var json1d = [[AnyHashable: Any]]()
|
var json1d = [[AnyHashable: Any]]()
|
||||||
for molecule in moleculeList {
|
for molecule in moleculeList {
|
||||||
json1d.append((molecule as? ListItemModel)!.toJSON()!)
|
if let moleculeDictionary = (molecule as? ListItemModel)?.toJSON() {
|
||||||
|
json1d.append(moleculeDictionary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
json2d.append(json1d)
|
json2d.append(json1d)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -151,11 +151,9 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
var tmpMolecules = [ListItemModelProtocol]()
|
var tmpMolecules = [ListItemModelProtocol]()
|
||||||
|
|
||||||
molecules.forEach { molecule in
|
molecules.forEach { molecule in
|
||||||
let data = try? JSONSerialization.data(withJSONObject: molecule)
|
if let data = try? JSONSerialization.data(withJSONObject: molecule), let listItemModel = try? JSONDecoder().decode(ListItemModel.self, from: data) {
|
||||||
let listItemModel = try? JSONDecoder().decode(ListItemModel.self, from: data!)
|
tmpMolecules.append(listItemModel)
|
||||||
let jsonData = try? JSONSerialization.jsonObject(with: data!, options: .allowFragments)
|
}
|
||||||
let json = String(data: data!, encoding: String.Encoding.utf8)
|
|
||||||
tmpMolecules.append(listItemModel!)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
@ -180,9 +178,9 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
var tmpMolecules = [ListItemModelProtocol]()
|
var tmpMolecules = [ListItemModelProtocol]()
|
||||||
|
|
||||||
molecules.forEach { molecule in
|
molecules.forEach { molecule in
|
||||||
let data = try? JSONSerialization.data(withJSONObject: molecule)
|
if let data = try? JSONSerialization.data(withJSONObject: molecule), let listItemModel = try? JSONDecoder().decode(ListItemModel.self, from: data) {
|
||||||
let listItemModel = try? JSONDecoder().decode(ListItemModel.self, from: data!)
|
tmpMolecules.append(listItemModel)
|
||||||
tmpMolecules.append(listItemModel!)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var indexPaths: [IndexPath] = []
|
var indexPaths: [IndexPath] = []
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user