Why is Refactor... grayed out (disabled) in Xcode?
I'd like to rename a class.
Xcode creates a new function, and highlights its name so you can rename it. If the lines of code reference parameters, Xcode includes those in the parameter list for the new function. To rename a parameter, Command-click it and choose Edit All in Scope, or Control-click it and choose Refactor > Rename.
Right click on class name and choose Rename. Show activity on this post. After doing what @Caroline has pointed out, you should also change the name of your . swift file because it does not change using Find > Find and replace... .
Select the class's symbol in its header file - i.e. the bit just after @interface
. Then the refactoring stuff should be enabled.
If you are using Objective-C++ (i.e. mix Objective-C with C++ code) then refactoring is disabled in xcode since it does not support refactoring of C++ code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With