Templates for Swift files #35
Closed
wojciech-kulik
announced in
Tips & Tricks
Replies: 1 comment
-
Moved to Wiki |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Often, you want to have templates for specific files in your project or at least you want to have a header (like when using Xcode).
I created a small function that fills in a new file with predefined template. Based on the file name suffix it can use the relevant template.
This function is also able to replace some placeholders like
{date}
,{filename}
, and{name}
. If you place{cursor}
in your template, the cursor will be automatically moved there.Sample template
templates/viewmodel.txt
Beta Was this translation helpful? Give feedback.
All reactions