title: Immutable/Mutable Collections in Swift
body: <p>I was referring to Apple's Swift programming guide for understanding creation of Mutable/ immutable objects(Array, Dictionary, Sets, Data) in Swift language. But I could't understand how to create a immutable collections in Swift. </p>
  
  <p>I would like to see the equivalents in Swift for the following in Objective-C</p>
  
  <p><strong>Immutable Array</strong></p>
  
  <pre><code>NSArray *imArray = [[NSArray alloc]initWithObjects:@"First",@"Second",@"Third",nil];
  </code></pre>
  
  <p><strong>Mutable Array</strong></p>
  
  <pre><code>NSMutableArray *mArray = [[NSMutableArray alloc]initWithObjects:@"First",@"Second",@"Third",nil];
  [mArray addObject:@"Fourth"];
  </code></pre>
  
  <p><strong>Immutable Dictionary</strong></p>
  
  <pre><code>NSDictionary *imDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"Value1", @"Key1", @"Value2", @"Key2", nil];
  </code></pre>
  
  <p><strong>Mutable Dictionary</strong></p>
  
  <pre><code>NSMutableDictionary *mDictionary = [[NSMutableDictionary alloc]initWithObjectsAndKeys:@"Value1", @"Key1", @"Value2", @"Key2", nil];
  [mDictionary setObject:@"Value3" forKey:@"Key3"];
  </code></pre>