title: In an Cocoa, OSX Swift application, how to get names of the subviews
body: <p>In our last OSX application, we needed getting subview names. Using following function we can check how many NSImageView in our given view but not the name (index numbers) of NSImageViews. Actually NSImageViews kept in an array and we need index number of NSImageViews.</p>
  
  <pre><code>// Returns how many NSImageViews we had in a given view.
  
  func subViewCheck (viewName viewName: NSView) -&gt; Int {
  
      var counter: Int = 0
      let views = viewName.subviews 
  
      for k in 0..&lt;views.count {
  
      if views[k].description.containsString("NSImageView")  { 
  
          counter += 1
  
          }
      }
  
  return counter
  
  }
  </code></pre>