Eu sou novo em programação e estou tentando fazer um efeito circular para CollectionView, tenho o seguinte:
override func prepare()
{
super.prepare()
let centerX = collectionView!.contentOffset.x + (collectionView!.bounds.width / 2.0)
attributesList = (0..<collectionView!.numberOfItems(inSection: 0)).map { (i)
-> CircularLayoutAttributes in
// 1
let attributes = CircularLayoutAttributes(forCellWithIndexPath: IndexPath(forItem: i, inSection: 0))
attributes.size = self.itemSize
// 2
attributes.center = CGPoint(x: centerX, y: self.collectionView!.bounds.midY)
// 3
attributes.angle = self.anglePerItem*CGFloat(i)
return attributes
}
Mas recebo o erro: Rótulos de argumento '(_ :)' não correspondem a nenhuma sobrecarga disponível, como na imagem, o que estou fazendo de errado?
A sintaxe mudou com Swift 3.
Usar:
IndexPath(item: i, section: 0)
Este artigo é coletado da Internet.
Se houver alguma infração, entre em [email protected] Delete.
deixe-me dizer algumas palavras