Answers for "update parent vc from child controller swift 5"

0

update parent vc from child controller swift 5

let nc = NSNotificationCenter.defaultCenter()
nc.addObserver(self, selector: #selector(printValue), name: "printValue", object: nil)

func printValue(notification:NSNotification) {
    let userInfo:Dictionary<String,String> = notification.userInfo as! Dictionary<String,String>
    let item = userInfo["value"]! as String

    print(item,self)
}
Posted by: Guest on June-15-2021
0

update parent vc from child controller swift 5

let nc = NSNotificationCenter.defaultCenter()
nc.postNotificationName("printValue", object: nil, userInfo: ["value" : "Pass Me this string"])
Posted by: Guest on June-15-2021

Code answers related to "update parent vc from child controller swift 5"

Code answers related to "Swift"

Browse Popular Code Answers by Language