Templates for Swift files #35
wojciech-kulik
announced in
Tips & Tricks
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Commonly, you want to have some templates for specific files in your project or at least you want to have a header (like when you use Xcode).
I created a small function that fills in a new file with a template that you defined. 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