-1

I'm trying to load a nib into a collection view cell programatically but I'm getting an NSException error. Can't figure out why.

    if let nib = Bundle.main.loadNibNamed("CardCellBottom", owner: self, options: nil)?.first as? CardCellNib {

        nib.translatesAutoresizingMaskIntoConstraints = false
        nib.frame = bounds
        bottomView.addSubview(nib)

    }

If I remove this code from the view everything works. So the issue lies here. "CardCellBottom" is correctly named and CardCellNib inherits from UIView.

Thanks

user7684436
  • 697
  • 14
  • 39

1 Answers1

0

I managed to solve the issue. Turns out the file name was incorrect. Hope this helps anyone out :)

user7684436
  • 697
  • 14
  • 39