0 votes
126 views
asked in Swift by (1.1k points)
Hi All

  How to create empty dictionary in swift?

1 Answer

0 votes
answered by (2.6k points)

Hi Arthi

 

As with arrays, you can create an empty Dictionary of a certain type by using initializer syntax:

var namesOfIntegers = [Int: String]()

  • // namesOfIntegers is an empty [Int: String] dictionary

Categories

...