Shows detailed source “About” page when adding 3rd-party sources

Allows users to preview sources before adding them to their AltStore.
This commit is contained in:
Riley Testut
2023-04-04 15:41:44 -05:00
committed by Magesh K
parent 5145e355ce
commit 654f73f4ee
12 changed files with 1718 additions and 31 deletions

View File

@@ -88,4 +88,20 @@ public extension NewsItem
{
return NSFetchRequest<NewsItem>(entityName: "NewsItem")
}
class func sortedFetchRequest(for source: Source?) -> NSFetchRequest<NewsItem>
{
let fetchRequest = NewsItem.fetchRequest() as NSFetchRequest<NewsItem>
fetchRequest.returnsObjectsAsFaults = false
fetchRequest.sortDescriptors = [NSSortDescriptor(keyPath: \NewsItem.date, ascending: false),
NSSortDescriptor(keyPath: \NewsItem.sortIndex, ascending: true),
NSSortDescriptor(keyPath: \NewsItem.sourceIdentifier, ascending: true)]
if let source
{
fetchRequest.predicate = NSPredicate(format: "%K == %@", #keyPath(NewsItem.source), source)
}
return fetchRequest
}
}