36 lines
980 B
Swift
36 lines
980 B
Swift
//
|
|
// FAHomeNewContentCell.swift
|
|
// Fableon
|
|
//
|
|
// Created by 长沙鸿瑶 on 2025/9/16.
|
|
//
|
|
|
|
import UIKit
|
|
import SwiftUI
|
|
|
|
class FAHomeNewContentCell: UICollectionViewCell {
|
|
|
|
private var hostingVC: UIHostingController<FAHomeNewView>?
|
|
|
|
func configure(_ viewModel: FAHomeViewModel) {
|
|
// self.contentConfiguration = UIHostingConfiguration(content: {
|
|
// FAHomeNewView(viewModel: viewModel)
|
|
// })
|
|
// .margins(.all, 0)
|
|
|
|
let uiView = FAHomeNewView(viewModel: viewModel)
|
|
if let hostingVC = hostingVC {
|
|
hostingVC.rootView = uiView
|
|
} else {
|
|
let hostingVC = UIHostingController(rootView: uiView)
|
|
hostingVC.view.backgroundColor = .clear
|
|
contentView.addSubview(hostingVC.view)
|
|
hostingVC.view.snp.makeConstraints { make in
|
|
make.edges.equalToSuperview()
|
|
}
|
|
|
|
self.hostingVC = hostingVC
|
|
}
|
|
}
|
|
}
|