How edit multiple lines on Xcode (shortcut)

It is possible with Xcode 10+, see the wwdc2018 presentation of the functionality.

Ways to create multiple cursors:

  • ⇧ Shift + ⌃ Control + Left Mouse Click: Will create a new cursor on every click
  • ⇧ Shift + ⌃ Control + : Will create a new cursor above
  • ⇧ Shift + ⌃ Control + : Will create a new cursor bellow
  • ⌥ Option + drag: Will create a new cursor on every line you drag

preview:

enter image description here

For more information, see this answer


I'm not sure how helpful this is to you, but if you want to change a variable name, you can click it, hover over it until the triangle dropdown button appears, click it and select Edit All in Scope.

This allows you to change all instances of that variable name.

enter image description here


Multiline editing is supported in Xcode 10, Ctrl + Shift + click the lines you want to edit.


Select the line you want to edit, then press option + command for a moment demo