title: Type DictionaryIterator does not conform to protocol 'Sequence' when returning DictionaryIterator from a container class
body: <p>This code has the Swift compiler complaining about the second iteration using the returned <code>DictionaryIterator</code>:</p>
  
  <pre><code>import Foundation
  
  class Container
  {
      private var mArray: [String] = ["One", "Two", "Three"]
      private var mDict: [Int:String] = [0: "value1", 1: "value2", 2: "value3"]
  
      func getArrayIterator() -&gt; IndexingIterator&lt;[String]&gt;
      {
          return mArray.makeIterator()
      }
  
      func getDictIterator() -&gt; DictionaryIterator&lt;Int, String&gt;
      {
          return mDict.makeIterator()
      }
  }
  
  let container = Container()
  
  for value in container.getArrayIterator()
  {
      print("Value: \(value)")
  }
  
  for (key, value) in container.getDictIterator() // Type 'DictionaryIterator&lt;Int, String&gt;' (aka 'Dictionary&lt;Int, String&gt;.Iterator') does not conform to protocol 'Sequence'
  {
      print("Key: \(key), value: \(value)")
  }
  </code></pre>
  
  <p><s>However, looking at the docs for the <code>Dictionary.Iterator</code> it seems it is actually conforming to protocol Sequence.</s><br>
  <strong>EDIT</strong>:
  It actually says that <code>Dictionary.Iterator</code> has a relationship "From Protocol" <code>Sequence</code></p>
  
  <p><a href="https://developer.apple.com/documentation/swift/dictionary/iterator" rel="nofollow noreferrer">https://developer.apple.com/documentation/swift/dictionary/iterator</a></p>
  
  <p>Why is this code not working?</p>