This commit is contained in:
Pfeil, Scott Robert 2020-09-22 09:24:38 -04:00
parent f771469bc5
commit d3fd303988
2 changed files with 5 additions and 6 deletions

View File

@ -32,7 +32,7 @@ import Foundation
guard let model = model as? NotificationXButtonModel else { return } guard let model = model as? NotificationXButtonModel else { return }
tintColor = model.color.uiColor tintColor = model.color.uiColor
// temporary // TODO: Temporary, consider action for dismissing top alert
if model.action.actionType == ActionNoopModel.identifier { if model.action.actionType == ActionNoopModel.identifier {
addActionBlock(event: .touchUpInside) { (button) in addActionBlock(event: .touchUpInside) { (button) in
(button as? NotificationXButton)?.closeTopAlert() (button as? NotificationXButton)?.closeTopAlert()

View File

@ -61,17 +61,16 @@ public extension MVMCoreUITopAlertView {
let delegateObject = MVMCoreUIDelegateObject.create(withDelegateForAll: self) let delegateObject = MVMCoreUIDelegateObject.create(withDelegateForAll: self)
guard let json = topAlertObject.json else { return nil } guard let json = topAlertObject.json else { return nil }
let model = try TopNotificationModel.decode(json: json, delegateObject: delegateObject) let model = try TopNotificationModel.decode(json: json, delegateObject: delegateObject)
guard let molecule = MoleculeObjectMapping.shared()?.createMolecule(model.molecule, delegateObject: delegateObject, additionalData: nil)/*, guard let molecule = MoleculeObjectMapping.shared()?.createMolecule(model.molecule, delegateObject: delegateObject, additionalData: nil) else {
let view = molecule as? MVMCoreUITopAlertBaseView*/ else { throw ModelRegistry.Error.decoderOther(message: "Molecule not mapped")
throw ModelRegistry.Error.decoderOther(message: "Molecule not a top alert")
} }
if let castView = molecule as? StatusBarUI { if let castView = molecule as? StatusBarUI {
let (color, style) = castView.getStatusBarUI() let (color, style) = castView.getStatusBarUI()
statusBarColor?.pointee = color statusBarColor?.pointee = color
statusBarStyle?.pointee = style statusBarStyle?.pointee = style
} }
// Temporary // TODO: Temporary, waiting for actual restriction from design.
molecule.heightAnchor.constraint(lessThanOrEqualToConstant: 150).isActive = true molecule.heightAnchor.constraint(lessThanOrEqualToConstant: 140).isActive = true
return molecule return molecule
} catch { } catch {
if let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: "\(self)") { if let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: "\(self)") {