top of page
Writer's pictureShubham Bakshi

Re-indent code after editing in Xcode

Consider the following example which is pretty straight forward:

Let say you change the method signature and add async throws to it, you'll have to change the caller accordingly which, to be honest, messes up the look and feel:

How the change of code messes up the indent

To resolve this you can do the following:

  1. Select the piece of code that feels out of place because of entering new keyword/s

  2. Press control(or Ctrl)+i key and it will re-indent the code:

How to re-indent the messed up code

bottom of page