I am new to swift and this is my first question here.
I tried creating a new file in the models and renaming it but that didn’t work. It shows the same error.
I tried clearing the build folder(shift+ command + k) and restarting my mac.
I have gone through a few answers here but none of them worked. Any help will be highly appreciated.
2
Answers
Creating a new Model folder and moving the file(WeatherManager.swift) solved the issue. But I didn't get why it worked.
Basically, the solution that worked for me is as follows.
Click on the particular file that’s not being found in context, in this case WeatherManager.swift, inspect the file, then check the target membership button, Also do the same for the controller file from which you want to use the WeatherManager, in this case, WeatherViewController.
I hope the attached screenshot helps.