I experienced some baffling and very worrisome behavior yesterday in IB.
After spending a day laying out a couple of screens, setting up constraints and loading graphics into my assets file for use in buttons... it was all looking good.
Then, for no apparent reason, IB reverted the storyboard and lost everything. I didn't even leave Xcode. All the graphics were replaced with the pixelated ?... but this happens every so often. That wasn't the biggest problem. The entire screen layout reverted to one from a full day earlier, with all of my work deleted. Fonts, positions, controls... all reverted to a state that was long, long gone.
I didn't rebuild. I launched the app on my phone to make sure I wasn't in a fugue, but nope, all of my work was still there. I quit Xcode and relaunched it... still the work was lost and I was looking at a long-gone storyboard layout. I double-checked that I had opened the version of the project I thought, and checked the timestamps on the files in the project. Yes, I was in the right project.
So then I wanted to know what other work was lost, so I clicked on the asset file to see if it still showed the last bitmap I added... and it did.
And then... all my work came back. All I did was click around in the project tree. I have only one storyboard.
Has anybody else experienced this? I'm wondering if this could be traced to the invisible "versioning" that Apple forced on everyone a few years ago, or some defect in APFS. Where could it have pulled the ancient version of the file from?
This is in Xcode 10.1 on OS 10.14.3.
Update:
I just remembered what happened before the disappearance of my work: Xcode hit a breakpoint on an always-executed line of code that it hadn't hit all day. The breakpoint had probably been deleted long ago. This points to a reversion of more than just IB content in the project.