title: How to create my own GMSMarker? (GoogleMaps, iOS) - Swift
body: <p>I would like to create my own markers because I need to track extra information about them (for example, date added, marker ID)...</p>
  
  <p>So I created another class, as follows:</p>
  
  <pre><code>    class myMarker: GMSMarker {
          var markerID: Int
          var addedDate: NSDate
  
      }
  </code></pre>
  
  <p>But I don't know what do to next... should I create an "init" method to populate my markerId and addedDate? or I should override the GMSMarker constructor (which is not "init")
  It can be</p>
  
  <pre><code>    class myMarker: GMSMarker {
          var markerID: Int
          var addedDate: NSDate
          var myMarker: GMSMarker
  
          init(marID: Int, date: NSDate, GMSMarker: markerwithoutDateNorId){
             self.markerID = marID
             self.addedDate = date
             self.myMarker = markerwithoutDateNorId
          }
       }
  </code></pre>
  
  <p>I really don't have an idea how to implement this. Maybe I don't even need to implement a constructor, but use the GMSMarker constructor (which I believe I inherited) and then use set methods to set marker ID and Date?</p>
  
  <p>Or I could override GMSMarker constructor, to then use super(what-is-expecting-here) and then I would add the date and marker ID.</p>
  
  <p>I really need to create my own type of marker, because I need to keep track of these things... for example, I would like, in a future, remove all markers older than 1 week for example... and if I don't keep track of markers date, that would me impossible.</p>
  
  <p>Im really need to Swift and programming in general. I'd really appreciate your help :) </p>