Reputation: 20289
I'm using Xcode 6.2 and I want to remove the information about the author/user/organisation at the beginning.
E.g.
//
// AppDelegate.h
// SomeProject
//
// Created by Some One on 31.03.15.
// Copyright (c) 2015 Some Organisation. All rights reserved.
//
Therefore I copied the files from the folder
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File\ Templates/Source/Header\ File.xctemplate/
to
/Users/my-user/Library/Developer/Xcode/Templates/File\ Templates/Source/Header\ File.xctemplate/
The content in ___FILEBASENAME___.h
was
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//
#ifndef ___PROJECTNAMEASIDENTIFIER_______FILEBASENAMEASIDENTIFIER_______FILEEXTENSION___
#define ___PROJECTNAMEASIDENTIFIER_______FILEBASENAMEASIDENTIFIER_______FILEEXTENSION___
#endif
and I changed it to
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created on ___DATE___.
//
#ifndef ___PROJECTNAMEASIDENTIFIER_______FILEBASENAMEASIDENTIFIER_______FILEEXTENSION___
#define ___PROJECTNAMEASIDENTIFIER_______FILEBASENAMEASIDENTIFIER_______FILEEXTENSION___
#endif
If I create a new Cocoa Touch class I always get the same old header. I also tried other categories (e.g. Cocoa Class.xctemplate, Objective-C File.xctemplate, Objective-C new superclass.xctemplate, ...), but nothing changed. What I'm doing wrong or which template is the correct one?
Links:
- Change templates in Xcode
- Changing the default header comment license in Xcode
- Xcode change/remove comment template
- Change copyright / top-comment / “header” on ALL new files in Xcode 5
- Remove copyright in Xcode generated source code
But most of the information there seems to be outdated.
Upvotes: 4
Views: 3324
Reputation: 987
Use IDETemplateMacros.plist
or swiftlint
rule
https://matrejek.eu/posts/customizing-xcode-header-comments/
Upvotes: 1