This is my goal: when I click a button, StartI want the buttons to Sendbe on. Below is what my view controller looks like when loading:

As you can see, the buttons are Senddisabled, which is necessary. And I turned it off by writing the following code in mine TaskListTableViewCell.swift(I deleted some other irrelevant code for the sake of brevity):
class TaskListTableViewCell: UITableViewCell {
@IBOutlet weak var sendButton: UIButton!
override func awakeFromNib() {
super.awakeFromNib()
sendButton.enabled = false
}
}
And just in case, this can help you better understand, here's what a view controller looks like in Main.storyboard:

And in mine TaskListViewControllerI have the following code:
@IBAction func startButtonTapped(sender: AnyObject) {
}
The problem is that I cannot find a way to change sendButton.enabled = true. I tried:
@IBAction func startButtonTapped(sender: AnyObject) {
let taskListViewController = TaskListViewController()
taskListTableViewCell.sendButton.enabled = true
}
I also tried:
class TaskListTableViewCell: UITableViewCell {
@IBOutlet weak var sendButton: UIButton!
func changeSendButtonEnabled() {
sendButton.enabled = true
}
override func awakeFromNib() {
super.awakeFromNib()
sendButton.enabled = false
}
}
And in my TaskListViewController.swiftI wrote:
@IBAction func startButtonTapped(sender: AnyObject) {
let taskListViewController = TaskListViewController()
taskListTableViewCell.changeSendButtonEnabled()
}
But both these solutions give this error: fatal error: unexpectedly found nil while unwrapping an Optional value.
IBOutlet , : IBOutlet , IBOutlet , IBOutlet Swift IBOutlet . .