remove !
This commit is contained in:
parent
7d5bee5654
commit
cb89795b4c
@ -107,12 +107,11 @@ open class Stack<T>: Container where T: StackModelProtocol {
|
||||
}
|
||||
|
||||
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
if model == nil {
|
||||
let data = try! JSONSerialization.data(withJSONObject: json!)
|
||||
let decoder = JSONDecoder()
|
||||
let model = try! decoder.decode(MoleculeStackModel.self, from: data)
|
||||
if let model = model {
|
||||
setWithModel(model, delegateObject, additionalData)
|
||||
} else {
|
||||
} else if let json = json,
|
||||
let data = try? JSONSerialization.data(withJSONObject: json),
|
||||
let model = try? JSONDecoder().decode(MoleculeStackModel.self, from: data) {
|
||||
setWithModel(model, delegateObject, additionalData)
|
||||
}
|
||||
}
|
||||
@ -182,7 +181,7 @@ open class Stack<T>: Container where T: StackModelProtocol {
|
||||
|
||||
/// Adds the stack item view
|
||||
func addView(_ view: UIView,_ model: StackItemModelProtocol, lastItem: Bool) {
|
||||
let stackModel = self.stackModel!
|
||||
guard let stackModel = self.stackModel else { return }
|
||||
guard !model.gone else {
|
||||
// Gone views do not show
|
||||
stackItems.append(view)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user