Steve O'Sullivan Steve O'Sullivan - 10 months ago 92
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>()