skip to Main Content

I am new to swift and this is my first question here.

I am getting this error

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


  1. Chosen as BEST ANSWER

    Creating a new Model folder and moving the file(WeatherManager.swift) solved the issue. But I didn't get why it worked.


  2. 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.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search