title: How can i call two NSPredicate in single fetch request. Core Data iOS Swift
body: <p>In my app I am using Core Data. Now I want to fetch data from database and for that I am using fetch request. But I want two use two <code>NSPrediate</code> in single fetch request so how can i do this.</p>
  
  <p>This is my code:</p>
  
  <pre><code>let feedfetch = NSFetchRequest(entityName: "Feed")
  feedfetch.predicate = NSPredicate(format: "userid == %@", userid)
  
  let fetchedPerson = try moc.executeFetchRequest(feedfetch)
  </code></pre>
  
  <p>But I want to use two or more predicate so how can I do this?</p>
  
  <p>I want to call all this in one fetch request so how can I do this</p>
  
  <pre><code>let feedfetch = NSFetchRequest(entityName: "Feed")
  feedfetch.predicate = NSPredicate(format: "userid == %@", userid)
  feedfetch.predicate = NSPredicate(format: "is_deleted == %@", "0")
  let sortDescriptor = NSSortDescriptor(key: "feed_id", ascending: false,selector: #selector(NSString.localizedStandardCompare))
  feedfetch.sortDescriptors = [sortDescriptor]
  
  let fetchedPerson = try moc.executeFetchRequest(feedfetch)
  </code></pre>