comments
This commit is contained in:
parent
f771469bc5
commit
d3fd303988
@ -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()
|
||||
|
||||
@ -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)") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user