// // SPSettingsViewController.swift // MoviaBox // // Created by 佳尔 on 2025/4/28. // import UIKit class SPSettingsViewController: SPViewController { //MARK: UI属性 private lazy var tableView: SPTableView = { let tableView = SPTableView(frame: .zero, style: .insetGrouped) tableView.delegate = self tableView.dataSource = self tableView.separatorStyle = .none tableView.rowHeight = 48 tableView.sectionFooterHeight = 0 SPSettingsCell.registerCell(tableView: tableView) return tableView }() override func viewDidLoad() { super.viewDidLoad() self.setBackgroundView(isShowGradient: false, bgImage: nil) self.title = "Settings".localized _setupUI() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.navigationController?.setNavigationBarHidden(false, animated: true) self.setNavigationNormalStyle() } } extension SPSettingsViewController { private func _setupUI() { view.addSubview(tableView) tableView.snp.makeConstraints { make in make.edges.equalToSuperview() } } } //MARK: -------------- UITableViewDelegate & UITableViewDataSource -------------- extension SPSettingsViewController: UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = SPSettingsCell.dequeueReusableCell(tableView: tableView, indexPath: indexPath) return cell } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 1 } func numberOfSections(in tableView: UITableView) -> Int { return 5 } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 12 } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 0 } }