How do I refactor Swift in Xcode?

后端 未结 4 1188
忘了有多久
忘了有多久 2020-12-13 23:26

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 sayi

4条回答
  •  攒了一身酷
    2020-12-14 00:09

    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.

提交回复
热议问题