title: UIKit - Using Plist to retrive image
body: <p>I'm banging my head over here.</p>
  
  <p><strong>Target</strong></p>
  
  <p>Creating plist that contains image keys. Loading and image by key name - on <strong>UIKit</strong></p>
  
  <p><strong>What i have tried so far :</strong></p>
  
  <p>Plist sample :</p>
  
  <pre><code>&lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;frames&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;flowerpattern_0.jpg&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;frame&lt;/key&gt;
              &lt;string&gt;{{2,2},{100,100}}&lt;/string&gt;
              &lt;key&gt;offset&lt;/key&gt;
              &lt;string&gt;{0,0}&lt;/string&gt;
              &lt;key&gt;rotated&lt;/key&gt;
              &lt;false/&gt;
              &lt;key&gt;sourceColorRect&lt;/key&gt;
              &lt;string&gt;{{0,0},{100,100}}&lt;/string&gt;
              &lt;key&gt;sourceSize&lt;/key&gt;
              &lt;string&gt;{100,100}&lt;/string&gt;
          &lt;/dict&gt;
  
  
      &lt;/dict&gt;
      &lt;key&gt;metadata&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;format&lt;/key&gt;
          &lt;integer&gt;2&lt;/integer&gt;
          &lt;key&gt;realTextureFileName&lt;/key&gt;
          &lt;string&gt;flower_pattern_plist.jpg&lt;/string&gt;
          &lt;key&gt;size&lt;/key&gt;
          &lt;string&gt;{1022,104}&lt;/string&gt;
          &lt;key&gt;smartupdate&lt;/key&gt;
          &lt;string&gt;$TexturePacker:SmartUpdate:2e0802c1c0d11825873827deec34bf23:622a62cd100e0ea2e4b15f2b6ecde20c:f7e873e0cfa3c1fd5648760bfa48db16$&lt;/string&gt;
          &lt;key&gt;textureFileName&lt;/key&gt;
          &lt;string&gt;flower_pattern_plist.jpg&lt;/string&gt;
      &lt;/dict&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p><strong>How i tried getting the image out :</strong></p>
  
  <pre><code>var myDict : NSDictionary?
  var temp = String()
  if let path = NSBundle.mainBundle().pathForResource("flower_pattern_plist", ofType: "plist") {
      myDict = NSDictionary(contentsOfFile: path)
  }
  if let dict = myDict {
      let image: AnyObject? = dict["frames"]!
      println(image)
      temp = image!.allKeys[0] as! String
  }
   self.CollageChild.backgroundColor = UIColor(patternImage: UIImage(named: temp)!)
  </code></pre>
  
  <p>but so far it fails , any suggestions? is it even possible?</p>