use

  1. Open the following directory and paste the Templates directory for your project directly into it
~/Library/Developer/Xcode
Copy the code
  1. Select the following options when creating the project

  2. Select when creating a class file

    Creating a class file

The effect

  1. chooseSingle View App No SceneCreated is notSceneDelegateSuch documents as blank project
Blank project with no SceneDelegate related files

  1. The Class files created by selecting Custom Cocoa Touch Class come with some initialization methods and pragma mark tag remarks

    Creating a class file

making

About the rough method, not too careful study, is mainly a convenient line, make a unified template, the code will be more standard point.

Xcode itself own template in/Applications/Xcode. The app/Contents/Developer/Platforms/iPhoneOS platform/Developer/Library/Xcode/Templates /

The directory is divided into Project Templates and File Projects for creating Projects and new files, respectively.

Copy this directory to ~/Library/Developer/Xcode and change it in the directory. Xcode is loaded with the same directory as Xcode.

*** No Scene is a new name ***

Single View App No Scene

Changes to what is displayed when creating a file are configured in that file

TemplateInfo. File

Templateinfo.plist description

Info. Plist file configuration

The same changes that create class files are in File Templates:

Custom Cocoa Touch Class

Add code to the class file template. For example, if I want to create a class that inherits from NSObjec, add the code in the file shown below.

Add code to the class file template

I’m just adding extension here

NSObject adds extension

*** FILEBASENAMEASIDENTIFIER is automatically replaced with the class name you typed ***

Diy: Xcode template