temp fix for arch issue
This commit is contained in:
parent
83d5721e68
commit
c5e80d602e
@ -18,6 +18,7 @@ import MVMCore
|
|||||||
public var style: String? = "standard"
|
public var style: String? = "standard"
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case moleculeName
|
||||||
case backgroundColor
|
case backgroundColor
|
||||||
case action
|
case action
|
||||||
case hideArrow
|
case hideArrow
|
||||||
@ -62,6 +63,7 @@ import MVMCore
|
|||||||
public override func encode(to encoder: Encoder) throws {
|
public override func encode(to encoder: Encoder) throws {
|
||||||
try super.encode(to: encoder)
|
try super.encode(to: encoder)
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||||
try container.encodeModelIfPresent(action, forKey: .action)
|
try container.encodeModelIfPresent(action, forKey: .action)
|
||||||
try container.encodeIfPresent(hideArrow, forKey: .hideArrow)
|
try container.encodeIfPresent(hideArrow, forKey: .hideArrow)
|
||||||
|
|||||||
@ -153,8 +153,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
molecules.forEach { molecule in
|
molecules.forEach { molecule in
|
||||||
|
|
||||||
let data = try? JSONSerialization.data(withJSONObject: molecule)
|
let data = try? JSONSerialization.data(withJSONObject: molecule)
|
||||||
let decoder = JSONDecoder()
|
let listItemModel = try? JSONDecoder().decode(ListItemModel.self, from: data!)
|
||||||
let listItemModel = try? decoder.decode(ListItemModel.self, from: data!)
|
|
||||||
|
|
||||||
tmpMolecules.append(listItemModel!)
|
tmpMolecules.append(listItemModel!)
|
||||||
}
|
}
|
||||||
@ -162,8 +161,8 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
guard let indexPath = self.tableView?.indexPath(for: sender) else { return }
|
guard let indexPath = self.tableView?.indexPath(for: sender) else { return }
|
||||||
var indexPaths: [IndexPath] = []
|
var indexPaths: [IndexPath] = []
|
||||||
for molecule in molecules {
|
for molecule in tmpMolecules {
|
||||||
if let info = self.getMoleculeInfo(with: tmpMolecules as! ListItemModelProtocol) {
|
if let info = self.getMoleculeInfo(with: molecule) {
|
||||||
self.tableView?.register(info.class, forCellReuseIdentifier: info.identifier)
|
self.tableView?.register(info.class, forCellReuseIdentifier: info.identifier)
|
||||||
let index = indexPath.row + 1 + indexPaths.count
|
let index = indexPath.row + 1 + indexPaths.count
|
||||||
self.moleculesInfo?.insert(info, at: index)
|
self.moleculesInfo?.insert(info, at: index)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user