title: Index of object in Array<Prototocol> in Swift
body: <p>I want to get the index of my current theme.
  My theme list is declared the following way </p>
  
  <pre><code>var themes:Array&lt;ThemeProtocol&gt; = []
  </code></pre>
  
  <p>I tried using 
  <code>let currentIndex = find(self.themes, self.currentTheme)</code> but it doesn't work.
  <img src="https://i.stack.imgur.com/rfZFx.png" alt="enter image description here"></p>
  
  <p>I also tried using </p>
  
  <pre><code>func currentThemeIndex()-&gt;Int? {
          let indecies = enumerate(self.themes)
          for (index, item) in indecies {
              if self.currentTheme == item {
                  return index
              }
          }
          return nil
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/amK84.png" alt="enter image description here">
  Any idea what I am doing wrong?</p>