Code templates for components

Is there a plugin or some built in way of providing a template for each component so that when copying an instance of the component it fills in various properties into the template.

eg in iOS code I have a class called MyButton, I don’t want to use the built in iOS code generator because it won’t use my class. If I could provide some text for the component like:

MyButton(variant: {{variant}})

Then when I copy or run something on an instance of the button component it will produce text like:

MyButton(variant: .primary)


MyButton(variant: .secondary)

depending on what variant the button I’ve selected is.

Or do I have to write a whole custom plugin?