Search code examples
swiftstoryboardinterface-builderios9xcode7

I lost some of my work while refactoring a storyboard on XCode? What can I do?


I have read the First Book from appcoda "Beginning programming with Swift"

One feature that I learned in said book and that I really liked while working with storyboards is the ability to refactor some storyboards when the amount of storyboards becomes too large, so at first I was doing it successfully, no problem whatsoever.

I began dividing my storyboards into smaller chunks like so

enter image description here

OH THE HORROR

then this happened

As soon as I pressed "refactor to storyboards" it didn't prompt me for a name as it did before but instead it renamed the new storyboard reference to "Main copy.storyboard"

enter image description here

Can I recover the storyboard that I lost?

When that happened, the old storyboard dissapeared and an exact copy of the main.storyboard appeared

CTROL-Z Did not work as I tried that immediately and I haven't versioned for the past 2 days or so (I know, that was really stupid)

If I can not recover the storyboard, can someone tell me why did this happen? I don't want to do this again

Btw, I am running the last version of XCode 7.2.1


Solution

  • Xcode may have put the lost storyboard in the Trash. Use the Finder to check. The Trash is the wastebasket-looking thing at the right or bottom end of the Dock.

    If the lost file is in the Trash, you may be able to right-click it and choose “Put Back” to send it back into your project folder. You may also need to add it back to your project in Xcode using File > Add Files to “MyProject”.