I have a well advanced project in Swift on Xcode. After a while I decided to add a custom property (to catch a UIColor) to UIButton Class by subclassing it. But I already have a whole bunch of buttons in my Interface Builder set and programmatically in my project itself.
Is there a clean way to change each instances of my old UIButton Class, in IB and in the project files, to my new one at once without messing everything ? Hope I have been clear… 😉 Thanks a lot
2
Answers
Actually not pretty clear but note that if you looking for clean way to effect for all instances is using Type properties like
static
andclass
will be good ideaI would do this outside of Xcode with the help of some shell scripting.
First, do a backup.
Then something like:
Check if everything still works in Xcode (if not, you still have a backup in the .orig files)
Lastly you might also want to change some classes in your Code from
UIButton
toMyButton
, but this cannot be automated since your code might reference some framework classes that sill will remainUIButton
s.