title: Associated objects and Swift arrays
body: <p>I have an associated object on a view extension that contains an array (a mutable array in this case).</p>
  
  <pre><code>var queue: NSMutableArray {
      get {
          if let queue = objc_getAssociatedObject(self, &amp;Key.queue) as? NSMutableArray {
              return queue
          } else {
              let queue = NSMutableArray()
              objc_setAssociatedObject(self, &amp;Key.queue, queue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
              return queue
          }
      }
  }
  </code></pre>
  
  <p>I would like to transform <code>NSMutableArray</code> into a Swift array but I cannot figure out how to do. This will prevent me to perform quite ugly casting. Any suggestion? </p>