skip to Main Content

I’m working on porting an app written in Xamarin.iOS over to native iOS using swift and since the UI is native iOS the storyboards should port over just fine by adding them to the native project which is working but I have a new more annoying issue and that is it can’t seem to discover the swift file its associated with when I open up the assistant.

I’ve tried a bunch of things including:

  • Deleting the DerivedData folder for my project
  • Removed swift file from the project and re-added it
  • Removed storyboard from project and re-added it
  • Create a brand new swift file and made that the class for the view controller

none of that worked. The only thing that does work is the Option + Click trick but that doesn’t allow me to add any outlets, claiming it can’t find any information on the class.

I’m really lost on what else to do. I’m using XCode 13.4.1 if that’s important to know.

2

Answers


  1. Chosen as BEST ANSWER

    I finally got it working, and I guess it makes sense but also doesn't.

    I was getting to a point I wanted to ensure my code was building and it was failing, I fixed the errors xcode was reporting and got it building successfully. I decided to look at a storyboard by chance and to my delight it was showing my view controller code.

    Guessing xcode is a stickler about the code building before it's going to let you work with the storyboard designer fully, which seems like that shouldn't matter to the designer but guess Apple feels like it should.

    so if you've tried everything others have suggested, ensure your project builds successfully, if it doesn't fix any build errors and rebuild until its successful.


  2. first thing can you check Xcode project compatibility.It is easy to change the project format in the Xcode file inspector:

    enter image description here

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