iosswiftxcode7.2

Not Showing EDStarRating in Custom class dropdown list?


I have integrated EDStarRating in my application. it is working fine on one viewcontroller. but strange problem is it is not working on another view controller.

I have searched almost all google quection releted to this problem but nothing is working for me.

I have deleted EDStarRating from my application added again. then also it is not showing in custom class drop down list. I have checked in build phases, it is there.

Another strange thing is it is not showing in custom class drop down but it is working fine on one view controller there is no issue. same thing trying to apply on another view controller it is giving error.

Unknown class _MyApplication14MYEDStarRating in Interface Builder file.

Appreciate for help


Solution

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