Rename or refactor files in Xcode

后端 未结 7 1251
借酒劲吻你
借酒劲吻你 2020-12-08 04:04

Is it possible to rename/refactor a class file and have it rename the actual file on disk? If so, how can I do this?

7条回答
  •  醉话见心
    2020-12-08 04:16

    Xcode 11.6, attempting to rename "foo.cpp" to "bar.cpp" does not work using the above methods. the REFACTOR option is greyed out. Instead, do the following:

    • In the Project Browser, find the file to rename, ie: foo.cpp
    • Right (2finger) click on foo.cpp
    • Select, "Show in File Inspector"

    Right side of screen, the file inspector appears.

    • In the Name field, type your new filename, press ENTER

提交回复
热议问题