Search code examples
iosswiftnsdictionary

Access data in NSDictionary using Swift


enter image description here

What's the syntax in Swift to access value of gross element?


Solution

  • You would be better pasting the console log as it's easier to understand.

    But you should be able to do...

    var results = //your dictionary
    
    let gross = results["data"]["gross"]