Ich versuche, dies zu ändern:NSPredicate in swift3
return [self.allAttributes filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(UICollectionViewLayoutAttributes *layoutAttributes, NSDictionary *bindings) {
return CGRectIntersectsRect(rect, layoutAttributes.frame);
}]];
in etwas, das in swift3 funktioniert. Bisher habe ich das versucht:
return self.allAttributes?.filtered(using: NSPredicate(block: { (layoutAttributes, bindings) -> Bool in
return rect.intersects(layoutAttributes.frame)
})) as! [UICollectionViewLayoutAttributes]?
aber natürlich ich Value of type 'Any?' has no member 'frame'
bekommen
Ich habe den ganzen Tag gesucht, aber ich kann nicht eine Lösung finden.
es funktioniert. Vielen Dank – mat