title: How to conform to MutableCollection?
body: <p>I have trouble finding documentation on how to conform to <a href="https://developer.apple.com/reference/swift/mutablecollection" rel="noreferrer"><code>MutableCollection</code></a>. Google is completely empty on that topic.</p>
  
  <p><strong>Example</strong>, I want to add conformance for <a href="https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_path" rel="noreferrer"><code>GMSPath</code></a>/<a href="https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_mutable_path" rel="noreferrer"><code>GMSMutablePath</code></a>:</p>
  
  <pre><code>import CoreLocation
  import GoogleMaps
  
  extension GMSPath: RandomAccessCollection {
  
      public var startIndex: Int {
          return 0
      }
  
      public var endIndex: Int {
          return count
      }
  
      public func index(before i: Int) -&gt; Int {
          return i-1
      }
  
      public func index(after i: Int) -&gt; Int {
          return i+1
      }
  
      public subscript(position: Int) -&gt; CLLocationCoordinate2D {
          return coordinate(at: UInt(position))
      }
  }
  
  extension GMSMutablePath: MutableCollection {  // Error!
  
      public override subscript(position: Int) -&gt; CLLocationCoordinate2D {
          get {
              return coordinate(at: UInt(position))
          }
          set {
              replaceCoordinate(at: UInt(position), with: newValue)
          }
      }
  }
  </code></pre>
  
  <blockquote>
    <p>Error: Type 'GMSMutablePath' does not conform to a) 'MutableIndexable', b) 'MutableCollection'.</p>
  </blockquote>
  
  <p>Documentation for <a href="https://developer.apple.com/reference/swift/mutablecollection" rel="noreferrer"><code>MutableCollection</code></a> states:</p>
  
  <blockquote>
    <p>To add conformance to the MutableCollection protocol to your own custom collection, upgrade your type’s subscript to support both read and write access.</p>
  </blockquote>
  
  <p>I did that.</p>
  
  <p><code>MutableCollection</code> inherits from <code>MutableIndexable</code>, the docs stating:</p>
  
  <blockquote>
    <p>In most cases, it’s best to ignore this protocol and use the MutableCollection protocol instead, because it has a more complete interface.</p>
  </blockquote>
  
  <p>Hm?</p>