Could not cast value of type UIView to [CustomView] using Xib
问题 I've seen a number of similar questions, but many aren't up-to-date, and none have fixed my issue. I have a custom Xib and class, CardView . When I try to instantiate it in code, I get Could not cast value of type 'UIView' to 'CardView' . Class is as follows: class CardView: NibView { @IBOutlet var contentView: UIView! @IBOutlet weak var wordLabel: UILabel! @IBOutlet weak var flipButton: UIButton! @IBOutlet weak var playButton: UIButton! override init(frame: CGRect) { super.init(frame: frame)