Go to the root of the project using terminal and then paste the below mentioned line
rm -rf ~/Library/Developer/Xcode/DerivedData
Once it is executed, you can verify by going to Xcode > Preference > Locations -> Tap arrow shows ["DeriveData"] end point.