如何在Xcode中为Swift使用代码格式化程序? [英] How to use code formatter in Xcode for Swift?

查看:417
本文介绍了如何在Xcode中为Swift使用代码格式化程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode代码格式化程序Swift

我正在尝试自动格式化用Swift编写的代码。如果您正在团队中使用CVS,并且不想合并数小时,则很有必要。

I'm trying to auto format my code written in Swift. It's necessary if you're working in team and using CVS and don't want to merge for hours.

Ctrl + I 只是缩进了一点,但是例如,我想在函数和所有类似Clang的东西之间留有适当的空间。

Ctrl+I just makes an indent, but for example i want to have proper space between functions and just all the stuff like in Clang.

推荐答案

我写了一个有关格式Swift代码的扩展应用程序: Swimat

I write a extension app about format Swift code: Swimat

有两种安装方式


  1. 酒桶安装泳帽

克隆此存储库,构建并重新启动Xcode。

Clone this repo, build and restart Xcode.

有关更多信息,请参见 https://github.com/Jintin/Swimat 信息

See https://github.com/Jintin/Swimat for more information

这篇关于如何在Xcode中为Swift使用代码格式化程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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