I see a number of questions about this, but few answers (one answer solved a previous similar issue, but not this one).
THE PROBLEM
I have an IBDesignable class. It derives from UIControl, but the same thing happens if I derive from UIView.
It basically looks like this:
@IBDesignable
open class RVS_Checkbox: UIControl { ... }
It works just fine (the link leads to this project, which is a "drop-in" UIControl class).
But it won't render in Interface Builder. I get this error:
Here is the error, verbatim:
The built product "/Volumes/Development/Developer/Xcode/DerivedData/RVS_Checkbox-ficjiiqrddckmjenmsrbrxvihaky/Build/Intermediates.noindex/IBDesignables/Products/Debug-appletvsimulator/RVS_Checkbox" does not exist in the file system. Make sure your built products contains either an application or a framework product.
First of all, this is a tvOS error, and this is an iOS-only class. I had a similar issue before, and this answer solved that for me. I wrapped the code in the #if...#else...#endif, like so:
#if os(iOS)
@IBDesignable
open class RVS_Checkbox: UIControl { ... }
#else
@IBDesignable
class RVS_Checkbox: UIView { }
#endif
I even gave it an empty "placeholder," in case it needed to be held.
No dice. Whatever I do, the IB error still happens, and the element doesn't render.
Like I said, it still works fine, and also displays the proper inspectable properties:
but it won't render.
Here's the error, next to the directory it's complaining about:
I am sure that I'm doing something wrong, but have no idea what. I tried deleting DerivedData, cleaning the project, tried all 4 of my targets, etc.
No dice.
Any ideas?