I want to initialize the presenter attribute of my UIView subclass, I do it in my init method but I have the error "Property 'self.presenter' not initialized at super.init call" in the required init?(coder) method.
I don't know how to initialize it since I can't add arguments to the required init?(coder) method.
class HorizontalBarChart: UIView {
private var presenter: HorizontalBarChartPresenter
init(barHeight: CGFloat, spaceBetweenBars: CGFloat) {
self.presenter = HorizontalBarChartPresenter(barHeight: barHeight, spaceBetweenBars: spaceBetweenBars)
super.init(frame: CGRect.zero)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}