I have view controller A that presents view controller B as a popover. What I'm trying to do is to get a value that's set in view controller B, back in view controller A.
My thought is that I would accomplish this by passing in a closure that takes a parameter and having view controller B calling that with the parameter.
So, in VC A, I have:
func update(val:String) {
}
Then, when I create VC B, I tried:
bVC.notifier = update
but I'm getting error:
Cannot assign value of type '(String, String) -> ()' to type '() -> {}'
Then, in view controller B:
public var notifier = {}
then I'm not really sure how to call it.
I've read through: https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Closures.html#//apple_ref/doc/uid/TP40014097-CH11-ID94 but don't think it covered this situation very well.