Это код, вызывающий предупреждение:
private override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? {
let attributes = super.layoutAttributesForItemAtIndexPath(indexPath)
let distance = CGRectGetMidX(attributes!.frame) - self.midX;
var transform = CATransform3DIdentity;
transform = CATransform3DTranslate(transform, -distance, 0, -self.width);
attributes!.transform3D = CATransform3DIdentity;
return attributes
}
Консоль также печатает:
Это, вероятно, происходит потому, что макет потока "xyz" изменяет атрибуты, возвращаемые UICollectionViewFlowLayout, не копируя их.
Как исправить это предупреждение?