title: How to create generic convenience initializer in Swift?
body: <p>I'm tackling with generics in Swift. I've got extension to <code>NSManagedObject</code> class and wanted to create initializer which is only available for classes which implements some protocol I defined. Now I've got something like below but this is not working and even not compiling. Could you help me make it working?</p>
  
  <pre><code>public extension NSManagedObject {
      public convenience init&lt;Self: Nameable&gt;(context: NSManagedObjectContext)     {
          let entity = NSEntityDescription.entityForName(Self.entityName(), inManagedObjectContext: context)!
          self.init(entity: entity, insertIntoManagedObjectContext: context)
      }
  }
  
  public protocol Nameable {
      static func entityName() -&gt; String
  }
  </code></pre>
  
  <p>Xcode says: "Generic parameter 'Self' is not used in function signature".</p>