I am trying to pass the information from one controller to another controller. I have two controllers 1.ViewController 2.SecondController. I want to pass information from ViewController to SecondController using UserDefaults.standard.set where i am trying to get the reference of viewController but i am encountering error saying "assigning non-property list object for key value "controller". Below is the code. Please help me
let defaults:UserDefaults = UserDefaults.standard
defaults.set(self, forKey: "controller")
defaults.synchronize()