I've got the same problem and also found a solution (well at least kind of).
This problem is very easy to reproduce on my Mac Mini M1 and Xcode 12.3.
Create a new UIKit project
Create a custom component class (e.g. like the code below)
Add a UIButton to your main ViewController
In the Identity inspector, change the button class to your custom component
Now the custom component will not be rendered in the IB and you will find an error message in the Issue Navigator. The only way to have it rendered is to change the build setting "Build Active Architecture Only" for Debug to "No" (instead of the default "Yes"). Now the custom button is rendered correctly in IB without the error message. Instead you get another message suggesting to revert to recommended settings. I have not encountered this problem on my MacBook Pro (Intel processor) so I guess this is only related to the M1 and the IB.
import UIKit
@IBDesignable class CustomRoundedButton: UIButton {
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
}
override func prepareForInterfaceBuilder() {
commonInit()
}
private func commonInit() {
self.clipsToBounds = true
self.layer.cornerRadius = self.bounds.size.height / 2
}
}