title: How to call static method provided by protocol in Swift
body: <p>How to access to <code>static</code> protocol method within a instance</p>
  
  <p>I have a list of <code>Contact</code>, the contact can be a <code>FamilyContact</code> that inherit from <code>Contact</code> and the <code>GroupStatus protocol</code></p>
  
  <p>I want to call the static method from <code>GroupStatus</code> but in vain...</p>
  
  <p>Here is my code</p>
  
  <pre><code>protocol GroupStatus {
      static func isPrivate() -&gt; Bool // static method that indicates the status
  }
  
  protocol IsBusy {
      func wizzIt()
  }
  
  class AdresseBook {
  
      private var contacts = [Contact]()
  
      func addOne(c: Contact) {
          contacts.append(c)
      }
  
      func listNonPrivated() -&gt; [Contact]? {
  
          var nonPrivateContact = [Contact]()
  
          for contact in contacts {
              // here is I should call the static method provided by the protocol
              if self is GroupStatus {
                  let isPrivate = contact.dynamicType.isPrivate()
                  if !isPrivate {
                      nonPrivateContact.append(contact)
                  }
              }
              nonPrivateContact.append(contact)
          }
  
          return nonPrivateContact
      }
  }
  
  class Contact : Printable {
  
      var name: String
  
      init(name: String) {
          self.name = name
      }
  
      func wizz() -&gt; Bool {
          if let obj = self as? IsBusy {
              obj.wizzIt()
              return true
          }
          return false
      }
  
      var description: String {
          return self.name
      }
  }
  
  class FamilyContact: Contact, GroupStatus {
  
      static func isPrivate() -&gt; Bool {
          return true
      }
  
  }
  </code></pre>
  
  <p>I can't compile <code>Contact.Type does not have a member named 'isPrivate'</code></p>
  
  <p>How can I call it ? It works if I delete the <code>static</code> keyword, but I think is more logical to define it static.</p>
  
  <p><strong>If I replace</strong></p>
  
  <pre><code>let isPrivate = contact.dynamicType.isPrivate()
  </code></pre>
  
  <p><strong>by</strong></p>
  
  <pre><code>let isPrivate = FamilyContact.isPrivate()
  </code></pre>
  
  <p>It works, but I can have more than 1 subclasses</p>
  
  <p><strong>If I remove the <code>static</code> keywork I can do it by this way :</strong></p>
  
  <pre><code>if let c = contact as? GroupStatus {
      if !c.isPrivate() {
          nonPrivateContact.append(contact)
      }
  }
  </code></pre>
  
  <p><em>But I want to keep the <code>static</code> keyword</em></p>