NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(id item,
NSDictionary *bindings) {
return [item isKindOfClass:[UILabel class]];
}];
let predicate = NSPredicate { (item, bindings) -> Bool in
return item.isKindOfClass(UILabel.self)
}
In this example, the predicate will match items that are of the class UILabel
.