title: Swift - Working with Dictionaries - Add multiple values
body: <p>I've been looking for answers to this problem, but unfortunately without success.</p>
  
  <p>I'm developing a mathematical app (Swift-based), which keeps data of every function the user enters.</p>
  
  <p>(I then need to draw the functions on an NSView using a Parser)</p>
  
  <p><strong>The data</strong> structure is <strong>saved</strong> into a <code>Dictionary</code> but I'm not able to <strong><em>add values and keys</em></strong>.</p>
  
  <p>The <code>Dictionary</code> is <strong>initialized</strong> like:</p>
  
  <pre><code>var functions = [String : [[String : NSBezierPath], [String : NSColor], [String : CGFloat], [String : Bool]]]();
  
  //1A.The String key of the main Dictionary is the value of the function, such as "sin(x)"
  //1B.The value of the `Dictionary` is an `Array` od `Dictionaries`
  
  //2.The first value is a dictionary, whose key is a String and value NSBezierPath()
  //3.The second value is a dictionary, whose key is a String and value NSColor()
  //4.The third value is a dictionary, whose key is a String and value CGFloat()
  //5.The first value is a dictionary, whose key is a String and value Bool()
  </code></pre>
  
  <p>To add the functions, I have implemented a method (I will report a part of) :</p>
  
  <pre><code>...
  
  //Build the sub-dictionaries
  
  let path : [String:NSBezierPath] = ["path" : thePath];
  let color : [String:NSColor] = ["color" : theColor];
  let line : [String:CGFloat] = ["lineWidth" : theLine];
  let visible : [String:Bool] = ["visible" : theVisibility];
  
  //Note that I'm 100% sure that the relative values are compatible with the relative types.
  //Therefore I'm pretty sure there is a syntax error.
  
  
  //Add the element (note: theFunction is a string, and I want it to be the key of the `Dictionary`)
  
  functions[theFunction] = [path, color, line, visible]; //Error here
  
  ...
  </code></pre>
  
  <p>I'm given the following <strong>error</strong>:</p>
  
  <pre><code>'@|value $T10' is not identical to '(String,[([String:NSbezierPath],[String : NSColor],[String : CGFloat],[String : Bool])])'
  </code></pre>
  
  <p>I hope the question was enough clear and complete.</p>
  
  <p>In case I will immediately add any kind of information you will need.</p>
  
  <p><strong><em>Best regards and happy holidays.</em></strong></p>