SequenceQuery
public final class SequenceQuery<T: Reflectable>: NilComparable, Matchable
A class that queries against CollectionType
properties in the T
class.
-
A class that queries against
CollectionType
properties in theT
class.Declaration
Swift
public let builder: PredicateBuilder<T>
-
A class that queries against
CollectionType
properties in theT
class.Declaration
Swift
public let property: String
-
Undocumented
Declaration
Swift
public final class SequenceQuery<T: Reflectable>: NilComparable, Matchable
-
Equivalent to creating this predicate:
class Kraken { var friends: [LegendaryCreature] } NSPredicate(format: "friends.@count == 0")
Fetch the `Kraken` object if it doesn’t have any friends
Declaration
Swift
@discardableResult public func isEmpty() -> FinalizedIncluder<T>
-
Creates a subpredicate that iterates through the collection property to return qualifying queries. Equivalent to creating this predicate:
class Kraken { var friends: [LegendaryCreature] } NSPredicate(format: "SUBQUERY(friends, $friend, friend.isHungry == true).@count > 0")
Fetch the `Kraken` object if it has any friends that are hungry
- Parameters:
- type: The type of the objects found in the collection property being subqueried.
- subbuilder: A closure that defines queries that describe each object found in the collection property being subqueried. The closure must return an instance of the
SubqueryMatch
enum.
Declaration
Swift
@discardableResult public func subquery<U: NSObject>(_ type: U.Type, subbuilder: (_ includeIf: PredicateSubqueryBuilder<U>) -> MatchType) -> FinalizedIncluder<T> where U: Reflectable