I have a class in swift with the following signature:
class CommentsVC: UITableViewController {
Giving me:
Class 'CommentsVC' has no initializers
It has the two bellow IBOutlets as well as two IBActions:
@IBOutlet weak var AddCommentView: UIView!
@IBOutlet weak var AddingCommentTextField: UITextField!
I also have two table view methods:
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
And
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
I have looked here however it does not work for this situation as I already do what they recommend.
What is going wrong and how can I fix it?
Update:
The below code seems to be the problem. On the other VC, which uses a prepare method to pass over this data, I am passing in a post object which is initialized the same way I am initializing the problematic code below. How do I fix this?
var selectedMedia : Media {
didSet {
self.comments = selectedMedia.comments
loadComments()
}
}