title: Swift 2: Specifying required variables in an abstract superclass
body: <p>I'm trying to write something that  a class and a protocol. I just want a sort of protocol with explicitly defined functions or.</p>
  
  <pre><code>protocol ObjectProtocol {
      var endpoint: String
  }
  
  class Object {
      // All subclasses must implement ObjectProtocol
  
      func printAPIEndpoint() { print(endpoint) }
  }
  </code></pre>
  
  <p>so that I can easily define classes like this: </p>
  
  <pre><code>class User: Object, ObjectProtocol {
      var endpoint = "localhost:3000"
  }
  </code></pre>
  
  <p>What's the best way to achieve something like this?</p>