I am trying to rename the class name in swift but it gives me error Can\'t refector swift code
. I want to know the best way to rename a file that will reflect in t
EDIT:
Starting Xcode 9 you're now to easily do it.
Highlight the code that you want to rename, right click and choose refactor
-> rename
.
Or you can also use the Editor
menu on top of the Xcode and choose refactor
-> rename
.
Solution Below XCode 9:
Find
-> Find and Replace in Workspace
ChatViewController
with ChatVC
then hit Enter
. This usually rename the naming in storyboard too, So it's really convinient, but just double check if you want to really make sure it's changed.