ios - Swift: '()' is not convertible to '[String : AnyObject]' -


I used a custom extension to combine two dictionaries But

Defined Dictionary Extension in AppDelegate

  Extension dictionary {mitting mixing & lt; K, V> (Q: as in the form of key)}}}  

The way to use this new extension

  Class func addFbTokenParameter (json: [string: anyObject]) - & gt; [String: any object] {If key manager. Gate string (chicane manager. Static wars kfb token)! = Blue {let token = chanachan manager. Gate string (chicane manager. Static wars kfb token)! Var tokenParams: [String: AnyObject] = [kFacebook: [kToken: Tokens]] var Last Paramars: [String: AnyObject] = Token Param. Merge (JSN) Final Returns Last Paramos} and {Jason Back}}  

I'm getting this error on this line:

  var Last Paramars : [String: any object] = token param. Merge (JSN)  

What does this error mean? And how do I fix it?

Thank you!

token param. Merge (JSN) is return zero aka () . You can decide only this code by:

  tokenParams.merge (json) var finalParams: [String: AnyObject] = token first  

Your extension needs to be returned to assign the mutated dictionary:

  extension dictionary {muteing mantric merge & lt; K, V> (Dict: [K: V]) - & gt; [K: V] {for the value of form {self.updateValue (v) in {k} (as: key as a key)}}}}}}  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -