Jintin / Swimat

An Xcode formatter plug-in to format your swift code.
https://jintin.github.io/Swimat/
MIT License
1.65k stars 89 forks source link

Closure in arguments #151

Closed PMExtra closed 7 years ago

PMExtra commented 7 years ago

My Code:

UIView.animate(withDuration: 0.3, animations: {
    someCode()
})

After Swimat:

UIView.animate(withDuration: 0.3, animations: {
    someCode()
    })

最後的括號我認為不需要縮進,再看一個更複雜的例子:

UIView.animate(withDuration: 0.3, animations: {
    someCode()
}) { finished in
    afterAnimation()
}

After Swimat:

UIView.animate(withDuration: 0.3, animations: {
    someCode()
    }) { finished in
    afterAnimation()
}

我認為 }) { finished in this line不縮進可以更清晰的展現代碼的層次。

(記得好像台灣的"行列"和大陸意義相反,我們認為row是行,column是列,所以我不確定我該說這行還是這列就只能說this line了😂)

Jintin commented 7 years ago

謝謝你的回報 行與列其實我不太會分 XD 有程式碼就看得懂了

Thanks for your feedback.

Jintin commented 7 years ago

請試試看 1.3.1 版,謝謝你

Please try v1.3.1 again. Thanks.