Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add time and date in custom/user Code Snippet in XCode

How can I add date time in my custom code snippet?

I need frequent use to add my codes on other codes, and for others, I need to add my name and date time.

I created a code snippet with shortcut _ase, but I am not finding any help on net how can I add time to it.

enter image description here

like image 701
Anoop Vaidya Avatar asked Apr 01 '13 14:04

Anoop Vaidya


1 Answers

You can't add date or time automatically using the native Xcode snippet grammar.

Snippets do not have anything other than token substitution using the <#VisibleTokenName#> syntax.

File templates are generated differently and have token substitution for a small subset of predefined tokens (like ___DATE___) in addition to the ability for custom tokens gathered in the UI.

You could write a bash script (or whatever) to update the snippet file for you with the correct date.

like image 81
Fruity Geek Avatar answered Oct 14 '22 00:10

Fruity Geek