Running into an error. What am I doing wrong? This is my second project with the same issue. PLEASE HELP!
import UIKit
struct TextCellViewModel {
let text: String
let font: UIFont
}
enum SectionType {
case productPhotos(images: [UIImage])
case productInfo(viewModels: [TextCellViewModel])
case relatedProducts(viewModels: [RelatedProductTableViewCellViewModel])
var title: String? {
switch
self {
case .relatedProducts:
return "Related Products"
default:
return nil
}
}
}
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
private let tableView: UITableView = {
let table = UITableView()
table.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
table.register(PhotoCarouselTableViewCell.self, forCellReuseIdentifier: PhotoCarouselTableViewCell.identifier)
table.register(RelatedProductTableViewCell.self, forCellReuseIdentifier: RelatedProductTableViewCell.identifier)
return table
}()
Selecting any option will automatically load the page