fixes production bug temporary

This commit is contained in:
Pfeil, Scott Robert 2020-03-25 11:58:16 -04:00
parent e97226fd3f
commit e563c0133a
2 changed files with 23 additions and 1 deletions

View File

@ -19,4 +19,26 @@ public class LabelToggleModel: MoleculeModelProtocol {
self.label = label
self.toggle = toggle
}
private enum CodingKeys: String, CodingKey {
case moleculeName
case backgroundColor
case label
case toggle
}
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey:.backgroundColor)
label = try typeContainer.decode(LabelModel.self, forKey:.label)
toggle = try typeContainer.decode(ToggleModel.self, forKey:.toggle)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(label, forKey: .label)
try container.encode(toggle, forKey: .toggle)
}
}

View File

@ -86,7 +86,7 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed.";
- (void)pinATopViewController:(UIViewController *)viewController {
self.statusBarHeightConstraint.active = NO;
id topGuide = viewController.view.safeAreaLayoutGuide.topAnchor;
id topGuide = viewController.topLayoutGuide;
self.statusBarBottomConstraint = [NSLayoutConstraint constraintWithItem:self.statusBarView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:topGuide attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
self.statusBarBottomConstraint.active = YES;
}