gpt4 book ai didi

ios - cocoa touch 框架 : Can't detect custom class in Storyboard

转载 作者:行者123 更新时间:2023-11-29 05:31:00 25 4
gpt4 key购买 nike

我有带有自定义 UICollectionView 类的 Cocoa Touch 框架。现在我想在我的项目中实现它。但是,它无法检测到我在 cocoa touch 框架中制作的自定义 UICollectionView 类。注意:下图中的自定义类是手动输入的(不像以前那样自动完成) enter image description here

enter image description here

这是我的 Cocoa 框架类:

public class LATransitionCell: UICollectionViewCell, LATransition {
private var initFrame: CGRect?
private var initCornerRadius: CGFloat?

override public func awakeFromNib() {
}
}

这是我想要导入该类的 View Controller 类(在这个 View Controller 类中,LATransitionCell 表现良好)

import LACoreUI

class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource {

private var hiddenCells: [LATransitionCell] = []
private var expandedCell: LATransitionCell?
private var isStatusBarHidden = false

@IBOutlet weak var collectionView: UICollectionView!

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 5
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
return cell
}
}

知道为什么会发生这种情况以及如何解决这个问题吗?谢谢!

最佳答案

我认为您尝试在错误的元素上定义它,请尝试选择单元格元素,然后尝试关联 UICollectionViewCell:

enter image description here

关于ios - cocoa touch 框架 : Can't detect custom class in Storyboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57572164/

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