title: How to get cgcolor from nscolor with pattern image using swift?
body: <p>Here my line</p>
  
  <pre><code>NSView *myview
  [self.myview.layer setBackgroundColor:[NSColor colorWithPatternImage:[NSImage imageNamed:@"myImageName.png"]].CGColor];
  </code></pre>
  
  <p>How to write these lines in  <code>swift language</code></p>
  
  <p>.</p>
  
  <p>Thanks</p>