Xcode file templates are a tool for creating code snippets to give you a better starting in your swift file.
Xcode provided many types of inbuilt templates to perform the basic work.
We can create the storyboards and xib and many files because Xcode provided us the multiple inbuilt templates.
Create Xcode templates to speed up our daywork and automatically create files and folders.
Xcode file templates help us to create any common code of snippets with each file.
We need to add some basic info in the header with files so we will create the file templates.
Customize The Files Header Using Templates
-> First we will create the property list file IDETemplateMacros.plist.
-> For every text macro, you want to customize, add a new key to the plist’s dictionary. For example, to change
the default file header, add an entry with the key FILEHEADER
.
-> File header key will take string data.
-> In the file header key, we will add the data in the below format.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>FILEHEADER</key> <string> /** * Webkul Software. * @package Mobikul App * @Category Webkul * @author Webkul &lt;support@webkul.com&gt; * @Copyright (c) Webkul Software Private Limited (https://webkul.com) * @license https://store.webkul.com/license.html ASL Licence * @link https://store.webkul.com/license.html */ </string> </dict> </plist> |
-> Then save the property list file and paste the file in the below path.
Path:- /Users/Username/Library/Developer/Xcode/UserData
-> Now create the files from the Xcode project and you get your given templates in the header of the file.
And thanks for reading this blog, for detail info please click here
For more blogs please click here.
So pls follow the above step and And if you have any issues or suggestions you can leave your message in the comment section I will try to solve this.