Member-only story
How To Edit Multiple Lines of a File in Xcode
Refactoring just got a whole lot easier

IDEs like Sublime Text, Atom and VSCode have had the ability to edit multiple lines for years and it saves me a ton of time. Xcode, however, has been lagging in that department.
Apple rolled out a huge Xcode refactor when they came out with Xcode 9 in 2017 but multi-line edit support was missing outside of the new Edit All In Scope.
Finally in Xcode 10 we have the ability to select multiple lines to edit our code!
Shift + Control + Click
First, hold Shift
and Control (^)
and then click where you want to select multiple lines and then start typing. One small caveat: unlike other text editors where you can click that same line to unselect the multi-line selection, Xcode doesn’t support that yet.

Option + Drag
Next, if you hold Option
and drag across multiple lines, you can select those lines and start typing to edit your code: