Sometime in the past week or two, the Storyboard editor in Xcode 7 beta (then beta 5, now also still in beta 6) stopped recognizing the IBOutlets in _some_ (not all) of my UIViewController subclasses. (NOTE: my app is a pure Swift 2, iOS 9-targeting project.)
Specifically, it cannot "see" the IBOutlets in VCs whose source files reside within my project's (app-specific) main folder, but it _can_ see them in (generic, non-app-specific) VCs that I keep in an "Externals" folder. What's more, if I move those app-specific VCs out of the main folder, the Storyboard editor sees their IBOutlets just fine:
(I can't seem to post any screenshots here, so here's a diagram:)
<Project Folder>
IIAM.xcodeproj <-- Project
Externals <-- Where I keep non-app-specific code and resources
Classes
Views <-- The Storyboard Editor sees the IBOutlets of all these files just fine
IIAM <-- All app-specific code and resources
Classes
Views <-- The Storyboard Editor doesn't recognize any IBOutlets of these files
But if I move the affected Views out of the IIAM folder:
<Project Folder>
IIAM.xcodeproj <-- Project
Externals <-- Where I keep non-app-specific code and resources
Classes
Views <-- The Storyboard Editor sees the IBOutlets of all these files just fine
IIAM <-- All app-specific code and resources
Classes
Views <-- The Storyboard Editor _does_ recognize IBOutlets these files when moved out here
In the Storyboard Editor , the "module" property for all the classes that aren't recognized is empty (note: it doesn't have the default, greyed-out "Current - IIAM", it just has greyed-out "None" ) — and even if I set the module name to that of my project, the IBOutlets still aren't recognized. Meanwhile, the modules of the VCs under "Externals" _do_ have the greyed-out "Current - IIAM".
So, it seems evident that the underlying problem is that the Storyboard Editor (and possibly Xcode generally) doesn't recognize my app-specific VCs as beloing to the app's module when they are stored under my app-specific "IIAM" folder (which, BTW, is where the AppDelegate and nearly all classes and resources are also located), but does when they are moved out of that folder.
I checked my target's build settings to confirm that all my VCs (external and app-specific) are specified. I've even gone so far as to examine the XML of my storyboard file, to see if I could spot any difference in how the VCs are specified and identified therein, and I did notice one thing: those VCs whose IBOutlets are recognized all have the attributes:
customModule="IIAM" customModuleProvider="target"
while (at least most of) those whose IBOutlets aren't recognized lacked the customModuleProvider="target" attribute. But even after I edited the storyboard file to set that attribute for all my VCs, the Storyboard Editor stil doesn't recognize them as belonging to my app's module, or recgonzie their IBOutlets. I've tried cleaning, rebuilding, nuking all Xcode preferences and derived data, reinstalling Xcode, and yet nothing makes any difference except moving my VCs to the top level of the project directory.
(Note that my app still executes fine, _if_ I manually add (or replace) IBOutlets in my source by control-dragging from the storyboard; BUT even when I do that, all such IBOutlets show up as unrecognized by the Storyboard Editor, with the little yellow warning icons. And of course I have to manually add _all_ IBOutlets this way, even those for such things as the view — which I then have to immediately delete from the VC source because of course it conflicts with the inherited view property, but this _does_ at least make a yellow-warning IBOutlet show up, and lets the app then run)
So, I'm at a complete loss. Has anyone else encountered this behavior? Does anyone have any idea how I might be able to fix the problem?
Help! And thanks!
Carl
OK, I don't know if this is really an "answer", but I was at least able to correct the issue. I was seeing the issue reported above on my laptop, which is my primary development machine, but I was also synching my project files to my desktop Mac. This morning I updated my desktop Mac to the latest Xcode beta and launched my project from there; and as I hoped, on that Mac, the Storyboard Editor "sees" my VCs and their IBOutlets just fine. Even better, after synching the files again with my laptop, everything behaves fine now on my laptop, too. So, the problem has been resolved, though I don't really have an explanation for what happened or a sure procedure to follow if it happens again.