mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
Supports filtering apps in BrowseViewController by category
This commit is contained in:
@@ -594,6 +594,13 @@ public extension StoreApp
|
||||
return predicate
|
||||
}
|
||||
|
||||
class var otherCategoryPredicate: NSPredicate {
|
||||
let knownCategories = StoreCategory.allCases.lazy.filter { $0 != .other }.map { $0.rawValue }
|
||||
|
||||
let predicate = NSPredicate(format: "%K == nil OR NOT (%K IN %@)", #keyPath(StoreApp._category), #keyPath(StoreApp._category), Array(knownCategories))
|
||||
return predicate
|
||||
}
|
||||
|
||||
@nonobjc class func fetchRequest() -> NSFetchRequest<StoreApp>
|
||||
{
|
||||
return NSFetchRequest<StoreApp>(entityName: "StoreApp")
|
||||
|
||||
Reference in New Issue
Block a user