title: Realm.io and compound primary keys
body: <p>I'm using Realm for Swift 1.2, and I'm wondering how to implement a compound primary key for an entity.</p>
  
  <p>So you specify your primary key by overriding <code>primaryKey()</code></p>
  
  <pre><code>override static func primaryKey() -&gt; String? { // &lt;--- only 1 field
      return "id"
  }
  </code></pre>
  
  <p>The only way I can see is to create another compound attribute like so</p>
  
  <pre><code>var key1 = "unique thing"
  var key2 = 123012
  
  lazy var key: String? = {
      return "\(self.key1)\(self.key2)"
  }()
  
  override static func primaryKey() -&gt; String? {
      return "key"
  }
  </code></pre>
  
  <p>How do you properly supply compound keys in Realm?</p>