In a UICollectionViewCell
, is it possible to set a SwiftUI View
?
struct MyView: View {
// ...
}
class MyCollectionViewCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
self.contentView.addSubview(MyView()) // How to set this?
}
}
For the collection view cell, I want to use a Swift UI view. How to set the UICollectionViewCell
's content view to MyView
?