Reputation: 2789
To be on the safe side, and as my project is relatively small, when I wanted to change the name of a class in Swift, I changed it manually and went through the files individually - storyboard, class file, and in project navigator.
In Xcode, is there another way to do this to be sure of replacing all instances, or is manually the only way to go? Can you safely use a find and replace for this purpose?
Upvotes: 1
Views: 65
Reputation: 131408
Select the class name in the declaration, right-click/control click on it, choose "refactor" and select "rename". That will do a complete rename, including references to the class from your storyboards. It's much safer than doing it manually (assuming the Swift editor is as smart as the Objective-C editor - I'm still pretty new to Swift development, so I haven't tested this feature with Swift.)
(As of version 6.2, Xcode is only capable of doing this with Objective-C and C code.)
Upvotes: 2