Swift – How to refactor Swift in Xcode

refactoringswiftxcode7

Is there a way to refactor swift in Xcode 7.1?

When I try to rename a variable (e.g. highlight, right-click, refactor > rename), Xcode pops up an error dialog saying:

Can't refactor Swift code. Xcode can only refactor C and Objective-C code.

Is there a workaround for this?

Best Answer

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