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 }
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()

View File

@ -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)") {