I have converted an Objective-C method into Swift. And then, into the Swift code i am getting this error. I have no tied what i have done wrong.
Objective-C Code
- (id)initWithCoder:(NSCoder *)aDecoder
{
if ((self = [super initWithCoder:aDecoder])) {
[self loadChecklistItems];
}
return self;
}
Swift 2.2 code
convenience required init(coder aDecoder: NSCoder) {
if (self.init(coder: aDecoder)) { // ERROR Here
self.loadChecklistItems()
}
}
Here is the screenshot of Swift code
Please tell me what i have done wrong and what will be the right code.