Answer the question
In order to leave comments, you need to log in
How to make a template for Xcode that will add a new class and integrate it into existing ones?
Let's say there is a factory class MyFabric and a self-written File Template for Xcode.
When creating a new file with class A from a template, I also want to supplement the existing factory so as not to write the same type of code like
class MyFabric {
func createObjA() -> A {
return A()
}
//etc.
}
Answer the question
In order to leave comments, you need to log in
What you want to do, Xcode most likely will not be able to do out of the box.
There is an option to generate an extension for the factory in the generated file, but this is not very flexible and visual.
You can also take a look at the Generamba project . This is a code generator that can create entire application modules using templates.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question