iosswiftnsnotificationcenter

Cannot convert value of type '[UserModel]' to expected argument type '[AnyHashable : Any]?'


enter image description here

i am getting this error when trying to pass model in userInfo params


Solution

  • It's a dictionary, you need a key. You can then pull it out on the receiver by key, or pull the first item from the dictionary.

    userInfo: ["model":self.userModel]