1、
全局下载https://github.com/realm/SwiftLint/releases安装
或者 pod 安装
pod 'SwiftLint'
2、添加运行脚本(Run Script Phase)
打开项目,project->Targets->Bulid Phases->加号->New Run Script Phase
image.png
3、添加脚本
全局安装脚本:
if which swiftlint >/dev/null; then
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
pod 安装脚本
"${PODS_ROOT}/SwiftLint/swiftlint"
网友评论