thanks @darkpaw. Is there a time frame in which notification has to pass ? As VC1 to VC6 takes a while as i have image upload and data entry in other views.
// Post part
NotificationCenter.default.post(name: Notification.Name("PassData"), object: nil, userInfo: ["data": "apple It is"])
// Destination Part
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(handleNotification(:)), name: Notification.Name("PassData"), object: nil)
}
@objc func handleNotification( notification: Notification) {
if let data = notification.userInfo?["data"] as? String {
print(data)
}
--------- I am still unable to get the result printed (print data). Does notification works if there is multiple views between them.
Post
Replies
Boosts
Views
Activity
@Polyphonic thank for the input. Will look more into how to do the " allow the spacing the expand a bit if there's enough room" part.