Steve O'Sullivan Steve O'Sullivan - 1 year ago 136
Swift Question

Getting "Expected expression" error when declaring a dictionary in Swift 3, Xcode 8

Working through "Cocoa Programming For OS X", and I am getting an error when declaring a dictionary using Swift 3.0 in Xcode 8 Version 8.0 (8A218a). I think my syntax is correct?

var dictionaryCapitalsByCountry: Dictionary [String: String]()

Shows up in playground with error, "Expected expression"

Answer Source
var dictionaryCapitalsByCountry: Dictionary<String, String> = Dictionary<String, String>()
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download