title: Cast to typeof(self)
body: <p>Is it possible to make a category (extension) that would eventually return an object casted to <code>instancetype</code>? I have a category to loads SKS files but since this category is for <code>SKNode</code> then all other subclasses like <code>SKScene</code> or <code>SKEmitterNode</code>, etc.. will adopt it too.</p>
  
  <p>So I would simply like to avoid always casting from <code>SKNode</code> to <code>instancetype</code>. Is it possible to change return type to <code>instancetype</code> and make sure that compiler is happy with return value?</p>
  
  <p>I think I can use <code>-&gt; Self</code> as return type but then I have no idea how to cast <code>scene</code> to instancetype so this thing would compile..</p>
  
  <p>For example:</p>
  
  <p><code>SKEmitterNode.unarchiveFromFile("Blah")</code> would return an instance of <code>SKEmitterNode</code></p>
  
  <pre><code>extension SKNode {
      class func unarchiveFromFile(file: String) -&gt; SKNode {
          let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks")
          var sceneData = NSData.dataWithContentsOfFile(path, options: .DataReadingMappedIfSafe, error: nil)
  
          let unarchiver = NSKeyedUnarchiver(forReadingWithData: sceneData)
          unarchiver.setClass(self.classForKeyedUnarchiver(), forClassName: "SKScene")
  
          let scene = unarchiver.decodeObjectForKey(NSKeyedArchiveRootObjectKey) as SKNode
          unarchiver.finishDecoding()
  
          return scene
      }
  }
  </code></pre>