Files
suixinkan_ios_uikit/suixinkan_ios/Features/Home/ViewControllers/HomePlaceholderViewController.swift
汉秋 d99a5b1bf8 Advance UIKit rewrite with AMap integration and core UI modules.
Integrate高德 SDK with simulator-safe build flags, add map views for operating area and punch points, refactor main tabs and key feature screens to UIKit with Diffable lists, and document Swift concurrency defaults in AGENTS.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 15:16:12 +08:00

66 lines
2.0 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// HomePlaceholderViewController.swift
// suixinkan
//
// Created by Codex on 2026/6/26.
//
import SnapKit
import UIKit
/// UIKit
final class HomePlaceholderViewController: UIViewController {
private let pageTitle: String
private let uri: String?
///
init(title: String, uri: String? = nil) {
pageTitle = title
self.uri = uri
super.init(nibName: nil, bundle: nil)
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
/// UI
override func viewDidLoad() {
super.viewDidLoad()
title = pageTitle
view.backgroundColor = UIColor(hex: 0xF5F7FA)
let iconView = UIImageView(image: UIImage(systemName: "square.grid.2x2"))
iconView.tintColor = AppDesign.primary
iconView.contentMode = .scaleAspectFit
let titleLabel = UILabel()
titleLabel.text = pageTitle
titleLabel.font = .systemFont(ofSize: 20, weight: .semibold)
titleLabel.textColor = AppDesign.textPrimary
titleLabel.textAlignment = .center
let uriLabel = UILabel()
uriLabel.text = uri
uriLabel.font = .systemFont(ofSize: 14)
uriLabel.textColor = AppDesign.textSecondary
uriLabel.textAlignment = .center
uriLabel.numberOfLines = 2
uriLabel.isHidden = uri?.isEmpty != false
let stack = UIStackView(arrangedSubviews: [iconView, titleLabel, uriLabel])
stack.axis = .vertical
stack.spacing = 12
stack.alignment = .center
view.addSubview(stack)
stack.snp.makeConstraints { make in
make.center.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(24)
}
iconView.snp.makeConstraints { make in
make.width.height.equalTo(44)
}
}
}