在XCode的自定义/用户代码段中添加时间和日期 [英] Add time and date in custom/user Code Snippet in XCode

查看:156
本文介绍了在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.

我使用_ase快捷方式创建了一个代码段,但在网上找不到任何帮助,我该如何增加时间.

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

推荐答案

您无法使用本机Xcode代码段语法自动添加日期或时间.

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

除了使用<#VisibleTokenName#>语法进行令牌替换外,代码片段没有其他任何内容.

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

文件模板的生成方式有所不同,除了可以在UI中收集自定义令牌之外,还可以使用一小部分预定义令牌(例如___DATE___)替换令牌.

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.

您可以编写一个bash脚本(或其他任何脚本)以正确的日期为您更新代码段文件.

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

这篇关于在XCode的自定义/用户代码段中添加时间和日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆