add init(from:) for classes with superclasses
This commit is contained in:
parent
3e04e32ce7
commit
b07ea34f57
|
|
@ -27,6 +27,15 @@ import LeadKit
|
|||
{%- endif %}
|
||||
}
|
||||
|
||||
{% if hasParent %}
|
||||
required init(from decoder: Decoder) throws {
|
||||
{%- if fields is not empty %}
|
||||
{% include 'blocks/class/fields-initialization-from-decoder.twig' with { fields: fields} %}
|
||||
{% endif %}
|
||||
try super.init(from: decoder)
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if (not hasGenerics) and (not fieldsHasGenericsOrNonEqutableCollections) -%}
|
||||
func isEqual(to other: {{ classType }}?) -> Bool {
|
||||
guard let other = other else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue