Storyboard Uiviewcontroller, 'Custom Class' Not Showing in Drop Down

Storyboard uiviewcontroller, 'custom class' not showing in drop down

Two ways I found that solve the problem but they are work arounds:-

  1. Just type the view controllers name in the text field, or
  2. close the project and then reopen it and in the project initialization it places the file on the list.

Not Showing EDStarRating in Custom class dropdown list?

Are you writing both the view controller that it works on and the one it doesn't in Swift? That you're getting a module-mangled class name for an Objective-C class suggests that you're running into a form of this bug:

Objective-C class is interpreted as Swift class in Interface Builder

Actual Results:
Outlet will refer to a Swift class - Name is mangled with App module name, so it can't resolve to an instance of that class.

The result is the subview having the original class in interface builder. If it was dragged from a 'View', it will be an instance of UIView, if it was dragged from 'ImageView', it will be an instance of UIImageView.

What I'd suggest is taking a look at the source of your storyboard (right click, Open As > Source Code) and manually copying the customClass from the instance that works to the instance that doesn't. Assuming they are different, and Interface Builder just got confused. If they're not different ... then there's some more subtle Swift/Objective-C bridging problem. Probably just rewriting EDStarRating in Swift would be quicker than figuring it out, really.

Custom Classes not appearing in Storyboard

I was able to fix the problem by restarting my computer again!

I think that you must need to clean your build folder and then restart.

Thanks guys for your comments!

why storyboard ui elements not showing on UIViewController in xcode 9

Debugging the viewcontroller can be difficult sometimes due to many views in the hierarchy, you can copy the UIElements one by one and try to make a copy of it. Then check which UIElement making the problem.



Related Topics



Leave a reply



Submit