Wednesday, February 14, 2024
HomeiOS Developmentios - How can I put one dictionary inside one other in...

ios – How can I put one dictionary inside one other in Swift, making certain that the keys of the second dictionary are restricted to these of the primary dictionary?


Beneath is an instance of the primary dictionary (firstDict), and I need to embody it within the second dictionary (secondDict).

var firstDict = ["firstKeyFirstDict": ["firstValue", "secondValue"], "secondKey": ["firstValue", "secondValue"]]

And secondDict is simply one other Dictionary with basicn key values

var secondDict = ["firstKey": "nameValue", "secondKey": "scndValue"]

Now I need to have consequence once I nest first into one other like this

["firstKey": "nameValue", "secondKey": "scndValue", "firstKeyFirstDict": ["firstValue", "secondValue"], "secondKey": ["firstValue", "secondValue"]]



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments