This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for type in types.structs %} | |
{% if type|annotated:"AutoInit" %} | |
{% set spacing %}{% if type.parentName %} {% endif %}{% endset %} | |
{% map type.storedVariables into parameters using var %}{{ var.name }}: {{ var.typeName }}{% if var.defaultValue %} = {{ var.defaultValue }}{% endif %}{% endmap %} | |
{% map type.storedVariables into parametersInit using var %}{{ var.name }}: {{ var.name }}{% endmap %} | |
// sourcery:inline:auto:{{ type.name }}.AutoInit | |
{{spacing}} {{ type.accessLevel }} init({{ parameters|join:", "}}) { // swiftlint:disable:this line_length | |
{{spacing}} {% for variable in type.storedVariables %} | |
{{spacing}} self.{{ variable.name }} = {{ variable.name }} | |
{{spacing}} {% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// swiftlint:disable all | |
#if swift(>=4.2) | |
#else | |
protocol CaseIterable { } | |
{% for enum in types.based.CaseIterable|enum %} | |
{{ enum.accessLevel }} extension {{ enum.name }} { | |
{% if not enum.hasAssociatedValues %} | |
static let allCases: [{{ enum.name }}] = [ |