How to fix Unknown Class in Interface Builder when using SPM packages

Marius Ilie
Jan 25, 2021

--

I had a problem few days ago trying to use storyboards from a SPM package. I was unable to instantiate controllers from storyboard, even had the right class name and the right target module.

So… I googled it and I found a lot of posts about this problem.

Unknown class _TtC10MySPModule24ViewController in Interface Builder file.

I tried all methods found on web but nothing worked… Until I found this thread:

Thanks to Karim I fixed my code

  • Adding @objc(OBJCViewController) before my actual ViewController definition and…
  • Replacing ViewController with OBJCViewController in storyboard.

👋 :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response