Answer the question
In order to leave comments, you need to log in
Why is a delegated function not being called in swift?
Good afternoon! Delegation question. Why is the delegate not executed in MainTableViewController? gives no errors.
You can’t put segue here, I’ve been suffering for the second day.
Answer the question
In order to leave comments, you need to log in
First, this is strange:
var delegate: sideBarDelegate!
...
self.delegate?.sidebarParse
Second, the problem is that you don't store the resulting sideBarTVC in MainTableTVC. On exit from the function, it is removed from memory.
Can you do it like this
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let identifier = segue.identifier {
if identifier == "SideBarTVC" {
let vc = segue.destinationViewController
vc.delegate = self
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question