Code text in ViewController.swift in Xcode is suddenly not colored anymore (keywords, objects, etc.) except for types like string and int. Also autocompletion is not working anymore. Any other swift file within the same project, like AppDelegate for example is still fine, i.e. colored. Simulation of my project is also still working. I am using Xcode 12.4, macOS 10.15.7. It’s only happening with this specific project I’m working on, all my other projects are still ok. Restarting Xcode/rebooting the computer didn’t help. Any help is very appreciated, thanks!
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
Update: Clearing the folder Derived Data and cleaning the build folder didn't help, so I deleted "ViewController.swift" after copying the code and then pasted that code into a newly created file "ViewController". Seemed to be a bit of a "nuclear option" to me, especially since I still don't know, why this happened in the first place. But it did the trick.
Try clearing the Derived Data folder and then restarting your Mac.
click – Command and then , key
Go to Locations>Derived Data and delete the folder