How do I refactor Swift in Xcode? How do I refactor Swift in Xcode? swift swift

How do I refactor Swift in Xcode?


AFAIK the refactoring is not working with Swift right now, however, at least in the same file(scope), you can do the following:enter image description here


Xcode 9 - 10

Xcode 9 now supports refactoring in Swift. This was announced in WWDC 2017.

enter image description here


The lack of refactoring is astounding (especially as I am coming off of a major stint using VS) However I have just noticed that someone has done something about it. On GitHub there is Refactorator Xcode Plugin (MIT license) which claims:

Refactorator is an Xcode plugin for refactoring Swift & now Objective-C code. It will rename public or internal vars, functions, enums etc. For private and local entities use Xcode's existing "Edit All in Scope" functionality.

Full disclosure is that I have nothing to do with them and am just about to install the product myself.