gpt4 book ai didi

Swift UICollectionViewLayoutAttributes 参数标签 '(_:)' 与任何可用的重载不匹配?

转载 作者:行者123 更新时间:2023-11-30 11:58:27 27 4
gpt4 key购买 nike

声明变量时出现问题。这就是我的情况。

        let att = UICollectionViewLayoutAttributes(layoutAttributesForItem(at: indexPath))

enter image description here

如何解决这个问题?

最佳答案

我认为您正在查看 Swift 2 中的一个旧示例。此方法已从 Swift 3 重命名为 grand renaming 的一部分:

UICollectionViewLayoutAttributes(forCellWith: indexPath)

请参阅documentation

关于Swift UICollectionViewLayoutAttributes 参数标签 '(_:)' 与任何可用的重载不匹配?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47528301/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com