Search code examples
xcodeeditshortcutmultiline

How edit multiple lines on Xcode (shortcut)


I'm sorry, I don't find an already asked question for this problem...

in Xcode, what is the shortcut to edit multiples lines like the "CMD+click" of sublime text?

enter image description here


Solution

  • 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