From d3fd303988860f9fd767fc01a96b462a03eded16 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 22 Sep 2020 09:24:38 -0400 Subject: [PATCH] comments --- .../Molecules/TopNotification/NotificationXButton.swift | 2 +- MVMCoreUI/TopAlert/MVMCoreUITopAlertView+Extension.swift | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationXButton.swift b/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationXButton.swift index 434ddc3d..84b1abbf 100644 --- a/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationXButton.swift +++ b/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationXButton.swift @@ -32,7 +32,7 @@ import Foundation guard let model = model as? NotificationXButtonModel else { return } tintColor = model.color.uiColor - // temporary + // TODO: Temporary, consider action for dismissing top alert if model.action.actionType == ActionNoopModel.identifier { addActionBlock(event: .touchUpInside) { (button) in (button as? NotificationXButton)?.closeTopAlert() diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView+Extension.swift b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView+Extension.swift index 09cef092..8bf4860f 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView+Extension.swift +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView+Extension.swift @@ -61,17 +61,16 @@ public extension MVMCoreUITopAlertView { let delegateObject = MVMCoreUIDelegateObject.create(withDelegateForAll: self) guard let json = topAlertObject.json else { return nil } let model = try TopNotificationModel.decode(json: json, delegateObject: delegateObject) - guard let molecule = MoleculeObjectMapping.shared()?.createMolecule(model.molecule, delegateObject: delegateObject, additionalData: nil)/*, - let view = molecule as? MVMCoreUITopAlertBaseView*/ else { - throw ModelRegistry.Error.decoderOther(message: "Molecule not a top alert") + guard let molecule = MoleculeObjectMapping.shared()?.createMolecule(model.molecule, delegateObject: delegateObject, additionalData: nil) else { + throw ModelRegistry.Error.decoderOther(message: "Molecule not mapped") } if let castView = molecule as? StatusBarUI { let (color, style) = castView.getStatusBarUI() statusBarColor?.pointee = color statusBarStyle?.pointee = style } - // Temporary - molecule.heightAnchor.constraint(lessThanOrEqualToConstant: 150).isActive = true + // TODO: Temporary, waiting for actual restriction from design. + molecule.heightAnchor.constraint(lessThanOrEqualToConstant: 140).isActive = true return molecule } catch { if let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: "\(self)") {