Contextual type 'AnyObject' cannot be used with dictionary literal multi level dictionary <p>I'm running into an issue with creating a multi-level dictionary in Swift and have followed some of the suggestions presented here:</p> <pre><code>var userDict:[String:AnyObject]? = ["SystemId": "TestCompany", "UserDetails" : ["firstName": userDetail.name, "userAddress" : "addressLine1" userDetail.userAdd1]] </code></pre> <p>The use of <code>[String:AnyObject]?</code> works for the first level of the Dict, but Swift is throwing the same error at the next level Dict, <code>UserDetail[]</code>. Any suggestions would be greatly appreciated</p>