Created
January 12, 2022 10:00
-
-
Save grdsdev/381826e7b4f1c1764fba80baf720d9f8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 }}: {% if var.typeName|hasPrefix:"(" %}@escaping {% endif %}{{ var.typeName }}{% endmap %} | |
| // sourcery:inline:auto:{{ type.name }}.AutoInit | |
| {{spacing}}{{ type.accessLevel }} init({{ parameters|join:", " }}) { | |
| {{spacing}} {% for variable in type.storedVariables %} | |
| {{spacing}} self.{{ variable.name }} = {{ variable.name }} | |
| {{spacing}} {% endfor %} | |
| {{spacing}}} | |
| // sourcery:end | |
| {% endif %} | |
| {% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment