I've used the next code for adding subview into UIView in the custom cell:
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 36, height: 36))
imageView.image = UIImage(named: "addNewSkill.png")
cell.countView.addSubview(imageView)
where:
@IBOutlet var countView: UIView!
on my custom cell file. When I run my app it crashes with the next error in logs:
fatal error: unexpectedly found nil while unwrapping an Optional value
Printing description of cell.countView:
(UIView!) countView = nil
What is the problem and how can I fix it?