Swift: Resolving “No Assistant Results” in Xcode 12 — Check This FIRST!
So you’ve laid out your storyboard, imported your assets, completed some initial coding work, and now you’re ready to start creating outlets. There’s only one problem — you’re getting “No Assistant Results” when you open up the Assistant Editor!
In my previous post, I laid out the frustrations with Swift, and particularly, the changes in Xcode that can lead you down hair-pulling dead ends when you search Google for possible solutions. I will list the other solutions below, but check this first!
- Start by opening your view controller that should be linked to your storyboard and look for the class name. If you’re used to using a prior version of Xcode and attempted to organize and rename this class, you’ll notice that Rename is no longer a main contextual menu item:
2. Instead, it’s now been reassigned to the Refactor menu:
Note: By using this menu, it should deploy your name changes across the project. I’ve noticed this process to be flakey — still unsure if it’s me, the beta, or the Ghost of Coders Past?
3. Regardless, make note of your class name, in this case above, it’s “MainVC”
4. Head over to the storyboard that should be connected to the class, and select the View Controller in the Document Outline. This is where you’ve been seeing that dreaded “No Assistant Results”!
5. Open the Identity Inspector and identify what Class is currently selected:
6. Check the drop-down, and select the class name that you identified in Step
7. Success! You’ve now linked (or re-linked!) this view controller with the storyboard:
The basic concept of Occam’s Razor is that the simplest explanation is usually the correct one. Yet, if you’ve run into this problem, you likely didn’t see this solution at the top of any discussion forums. Here are some of the solutions presented elsewhere, just in case the above solution doesn’t work for you:
You can try deleting the project’s Derive Data.
Close the project. Note: do not quit the XCode.
Window->Organizer (or, Window->Projects, depending on your version of Xcode)
Find the project.
Delete the Derived data using the “Delete…” button.
Just run this command in the terminal to turn off Indexing:
defaults write com.apple.dt.XCode IDEIndexDisable 1
To turn it back on, run this:
defaults write com.apple.dt.XCode IDEIndexDisable 0