I\'m currently developing an iOS app using swift and Xcode 6 (Beta 3).
Everything went fine so far but now as my project grows, Xcode suddenly began indexing and it
It's definitely a Xcode bug and I reported that to Apple. When you have a large dictionary literal or a nested dictionary literal. You have to break your dictionary to smaller parts and add them with append method until they fix the bug. Xcode 8.2.1 (8C1002)
I too faced the same issue for Xcode 9.1. So i looked into Activity Monitor. There was swift process which was above 100%. Double Clicked it and Quit. Done. Now its working fine.
in my case i had the emulator open with an app builded with previous files. Just close de emulator
I was creating a dictionary like this
var dic1 = [
"isDestination" : self.isDestination ?? false,
"price" : self.price ?? ""
]
and self.price is of type Int and I was giving its fallback value as an empty string which screwed up the XCode compilation.
I had that problem when I was at the swift crunch in krakow a couple weeks ago. We had the code on github, experienced that indexing problem on a macbook, we tried pulling the repo on 2 other macbooks, same result.
It's clearly a bug, I don't know what is causing it, we tried whatever we could think of (clean, clean build folder, manually removing files not in the repo, rebooting, killing processes, etc.), and after a couple hours the only thing left to do was creating a new xcode project from scratch and manually importing the files from the other project.
Never happened again since then, neither on that nor on other projects.
I went to tools->task and contexts->clear contexts and that seemed to give the computer rest finally!