2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

iOSAdvent Calendar 2024

Day 20

Xcode16 文字数が長い行を複数行に整形する

Last updated at Posted at 2024-12-19

やり方

  1. Xcode > Settings > Text Editing Automatically reformat when completion codeにチェックを入れる
  2. Editor > Structure Reformat code at columnを実行

ショートカットはcontrol + option + I

対象のコードを選択しないと実行されないかも、その場合は 全選択command + Aと組み合わせて使えますね!

参考

Added the “Reformat to Width” command to the Editor > Structure menu. This command splits long lines containing member access and function call expressions onto multiple lines. The target width is given with the “Reformat code at column” setting on the Editing tab of Xcode > Settings > Text Editing. Reformatting can happen automatically when using code completion by checking the “Automatically reformat when completion code” checkbox. The editor can visually show column by checking the “Show reformatting guide”, which was formerly called the “Page Guide”. The target width can also be set using the max_line_length EditorConfig setting. (94577507) (FB10083417)

雑記

長い行(メンバアクセスや関数呼び出し式を含む長い行)
Xcode16アプデの同じ並びにある editorconfigの方が目玉感あるのですが、

個人的には本内容も十分有り難い機能でしたので紹介させていただきました。
徐々に使い勝手がよくなっていってる印象です。
Xcodeのアップデート情報はウォッチしていきたいですね。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?