title: How to get unique value from Realm database in swift
body: <p>I do news application in <code>swift</code> using <code>Realm database</code>. In my database have same news categories. How to get unique value from <code>Realm database</code>?
  I use primary key </p>
  
  <pre><code>class News: Object {
  
   dynamic var newsID: String = ""
   dynamic var newsTitle: String = ""
   dynamic var newsFullText: String = ""
   dynamic var newsImage: String = ""
   dynamic var newsAutor: String = ""
   dynamic var newsCommentCount: String = ""
   dynamic var newsSeenCount: String = ""
   dynamic var newsDate: String = ""
   dynamic var newsCategory: String = ""
  
     override static func primaryKey() -&gt; String? {
      return "newsID"
     }
  }
  </code></pre>
  
  <p>I'm try to get</p>
  
  <pre><code>let realm = try! Realm()
  let menuName = realm.objects(News)
  for i in menuName.filter("newsCategory") {
  nameLabel.text = i.newsCategory
  }
  </code></pre>
  
  <p>But it is not work.</p>