我有带有自定义 UICollectionView 类的 Cocoa Touch 框架。现在我想在我的项目中实现它。但是,它无法检测到我在 cocoa touch 框架中制作的自定义 UICollectionView 类。 注意:下图中的自定义类是手动输入的(不像以前那样自动完成)
这是我的 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
}
}
知道为什么会发生这种情况以及如何解决这个问题吗?谢谢!
最佳答案
关于ios - cocoa touch 框架 : Can't detect custom class in Storyboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57572164/