Used guard instead of if let because some code after the if let was removed
This commit is contained in:
parent
8d417068a9
commit
87613fb375
@ -89,7 +89,7 @@ extension Link: MVMCoreUIMoleculeViewProtocol {
|
||||
}
|
||||
|
||||
public func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
if let unwrappedJson = json {
|
||||
guard let unwrappedJson = json else { return }
|
||||
actionMap = unwrappedJson
|
||||
self.additionalData = additionalData
|
||||
self.delegateObject = delegateObject
|
||||
@ -100,13 +100,12 @@ extension Link: MVMCoreUIMoleculeViewProtocol {
|
||||
|
||||
titleLabel?.numberOfLines = 0
|
||||
titleLabel?.lineBreakMode = .byWordWrapping;
|
||||
setTitle(actionMap?.stringForkey(KeyTitle), for: .normal)
|
||||
setTitle(unwrappedJson.stringForkey(KeyTitle), for: .normal)
|
||||
|
||||
if let enabled = unwrappedJson[KeyEnabled] as? Bool {
|
||||
isEnabled = enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
return 31
|
||||
|
||||
Loading…
Reference in New Issue
Block a user