xCode默認是可以進行代碼格式化的,能滿足基礎開發需求,如果想要個性一些代碼對齊方式宏對齊,等號對齊,屬性對齊,xAlign就提供了以上三種功能,參考文中效果~
基礎效果
等號對齊:
屬性對齊:
宏對齊:
插件安裝
1.控制台命令
curl -fsSL http://qfi.sh/XAlign/build/install.sh | sh
2.手動安裝下載插件包:XAlign.xcplugin,將下載的插件放在~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/目錄下,Finder路徑尋找快捷鍵command + shift + G;
3.重啟xCode,加載xAlign;
4.卸載
curl -fsSL http://qfi.sh/XAlign/build/uninstall.sh | sh
手動安裝的直接到第二步~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/刪除插件即可~
5.通過xCode→Edit→XAlign中的選項,cmd+shift+x即可看到效果~
