I am new with Swift. I inherited a project. I saw it running on a device. However, when I checkout the code and it had many errors. I was able to clear out the errors. However, I run into this one that is baffling me. The project uses xib files as well. Here is the code.
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override init(frame: CGRect) {
super.init(frame: frame)
}
init(items:NSArray, viewController:AnyObject){
super.init()
//itemsArray = items
itemsArray = items as [AnyObject]
//commonInit(viewController as UIViewController)
commonInit(viewController as! UIViewController)
}
I get the error under the init(items:NSArray, viewController:AnyObject) method/function. The error is pointed at the "super.init()". It states "Must call a designated initializer of the superclass 'UIView' error"
I been searching, googling, asking others and nothing has turned up. Can I get help on fixing this error, or at least why this error happens? I would like understand so I can become a better software developer.
Edit: I would like to thank everyone for their insight and help. I found out the problem is bigger. I did the changes suggested in the super.init(frame: CGRect). I had to change an array property as well which was affecting the init function.