code cleanup and identation

This commit is contained in:
Subhankar Acharya 2020-03-06 16:19:54 +05:30
parent b4f36b03c7
commit c891b6763e
2 changed files with 30 additions and 25 deletions

View File

@ -14,7 +14,7 @@ import Foundation
// MARK: - Outlets // MARK: - Outlets
//----------------------------------------------------- //-----------------------------------------------------
var stack: Stack<StackModel> var stack: Stack<StackModel>
let headlineBody = HeadlineBody() let headlineBody = HeadlineBody(frame: .zero)
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Initializers // MARK: - Initializers
@ -41,8 +41,8 @@ import Foundation
guard let model = model as? ListOneColumnFullWidthTextBodyTextModel else { return } guard let model = model as? ListOneColumnFullWidthTextBodyTextModel else { return }
headlineBody.set(with: model.headlineBody, delegateObject, additionalData) headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
stack.restack() stack.restack()
}
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return 90 return 90
} }

View File

@ -15,12 +15,18 @@ public class ListOneColumnFullWidthTextBodyTextModel: ListItemModel, MoleculeMod
public init(headlineBody: HeadlineBodyModel) { public init(headlineBody: HeadlineBodyModel) {
self.headlineBody = headlineBody self.headlineBody = headlineBody
super.init() super.init()
setDefaults()
}
// Defaults to set
override public func setDefaults() {
super.setDefaults()
headlineBody.style = "item"
} }
private enum CodingKeys: String, CodingKey { private enum CodingKeys: String, CodingKey {
case moleculeName case moleculeName
case headlineBody case headlineBody
} }
required public init(from decoder: Decoder) throws { required public init(from decoder: Decoder) throws {
@ -34,6 +40,5 @@ public class ListOneColumnFullWidthTextBodyTextModel: ListItemModel, MoleculeMod
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName) try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(headlineBody, forKey: .headlineBody) try container.encode(headlineBody, forKey: .headlineBody)
} }
} }