fatal error: init(coder:) has not been implemented error despite being implemented
Replace your init with coder method:
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
Actually if you have your cell created in Storyboard - I believe that it should be attached to tableView on which you try to create it. And you can remove both of your init methods if you do not perform any logic there.
UPD: If you need to add any logic - you can do this in awakeFromNib() method.
override func awakeFromNib() {
super.awakeFromNib()
//custom logic goes here
}
Firstly, you need to call the super class' init(coder:)
method with the statement super.init(coder: aDecoder)
. You do that by adding
it right under the method signature like-
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
Secondly, you need to remove the statement,
fatalError("init(coder:) has not been implemented")
.
That should work.