Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created October 15, 2019 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/9bf92827063695bb45749f66215c5058 to your computer and use it in GitHub Desktop.
Save fitomad/9bf92827063695bb45749f66215c5058 to your computer and use it in GitHub Desktop.
/**
Construye un `NSFetchRequest` que enlazará directamente
con la vista.
*/
func fetchRequestFavoriteSessions() -> NSFetchRequest<Favorite>
{
let request: NSFetchRequest<Favorite> = Favorite.fetchRequest()
let sortDate = NSSortDescriptor(key: "createdAt", ascending: false)
let sortName = NSSortDescriptor(key: "name", ascending: true)
request.sortDescriptors = [ sortDate, sortName ]
return request
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment