I am getting this error message and I don't understand why. This is from a project I inherited that is using this pod called SwiftyOnboardOverlay.I read similar questions but none seem to fix the issue for me.
The name for the superclass init is the same as the one I am getting the error as you can see.
Error Message: "Initializer does not override a designated initializer from its superclass"
class WalkthroughOverlay: SwiftyOnboardOverlay {
...
override init(frame: CGRect) {//error here
super.init(frame:frame)
setupViews()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
...
}
And the parent initializers
open class SwiftyOnboardOverlay: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setUp()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
Edit 1:
Screenshots:
What's going on here? Thanks for any help.
Edit2:
Ok so the previous dev also had these extensions with convenience initializers:
extension UIView {
/// EZSwiftExtensions
public convenience init(x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat) {
self.init(frame: CGRect(x: x, y: y, width: w, height: h))
}
/// EZSwiftExtensions, puts padding around the view
public convenience init(superView: UIView, padding: CGFloat) {
self.init(frame: CGRect(x: superView.x + padding, y: superView.y + padding, width: superView.w - padding*2, height: superView.h - padding*2))
}
/// EZSwiftExtensions - Copies size of superview
public convenience init(superView: UIView) {
self.init(frame: CGRect(origin: CGPoint.zero, size: superView.size))
}
}