Reputation: 2663
I need help with Xcode 6.
It only happens with the project I'm working with. For the other one, code suggestion works.
What's wrong with my project?
Upvotes: 1
Views: 1767
Reputation: 392
Swift files will NOT have code completion for UI classes (e.g. UIImage, UIDevice) unless there is an "import UIKit" at the top of the file.
Upvotes: 1
Reputation: 1180
The answer was to delete ~/Library/Developer/Xcode/DerivedData/ModuleCache (while Xcode is closed)
Upvotes: 7
Reputation: 153
I have been researching the same issue on StackOverflow and here are what most threads suggest: delete Derived Data folder files (or maybe just the files relevant to your troublesome project!). It worked for me hence this answer. Details below:
Fix manually by deleting all the files in ~/Library/Developer/Xcode/DerivedData
Note: If Library folder is new to you, follow this CultOfMac article:
Library access on.
Open a Finder window and then navigate to the Home folder. That’s the one represented by the cute little house icon over in the sidebar. If you don’t see it, click on something like the Desktop or Documents folder, and then Command-click on the title bar of the window. You’ll get a drop-down menu that shows the file path of the current folder, which–if you’ve picked a folder from your Home directory–will show the Home folder somewhere in the list. Click on it to go to the Home folder.
Now, once you’re there, hit Command-J to bring up the View Options panel. You’ll see a checkbox to “Show Library Folder” somewhere in that panel, depending on the view your Finder window is in. Simply check it to show your User account’s Library folder. Now you can go in there and mess around to your heart’s content.
Note: Some StackOverflow members suggested pressing 'Escape' key or Command and + keys after the dot (.), others suggested typing a white space (control+space bar). However, your post seems to suggest it's project-specific (works for the other project) so it may prove useful to try different approaches. Hope this helps.
Upvotes: 2