Getting error while I'm trying to do is simply create an instance of my custom class
class CustomDetailView: UIImageView {
let packThumbImage = UIImageView()
let packFrameImage = UIImageView()
let packNameLabel = UILabel()
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override init(frame: CGRect) {
super.init(frame: frame)
}
}
var customPackView = CustomDetailView() // error here
var customPackView = CustomDetailView(frame: CGRect.zero)
Edit: You have no empty initializer. Thus, you must use an initializer with a parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With