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>
This commit is contained in:
@ -12,6 +12,7 @@ final class FeaturePlaceholderViewController: UIViewController {
|
||||
private let pageTitle: String
|
||||
private let uri: String
|
||||
|
||||
/// 初始化实例。
|
||||
init(title: String, uri: String) {
|
||||
self.pageTitle = title
|
||||
self.uri = uri
|
||||
@ -23,6 +24,7 @@ final class FeaturePlaceholderViewController: UIViewController {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
/// 视图加载完成后的 UI 初始化与数据绑定。
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
view.backgroundColor = UIColor(hex: 0xF5F7FA)
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
import Kingfisher
|
||||
import UIKit
|
||||
|
||||
/// `UIImageView` 远程图片加载扩展,统一走 Kingfisher 缓存与占位策略。
|
||||
extension UIImageView {
|
||||
/// 使用 Kingfisher 加载远程图片,并提供占位图与失败回退。
|
||||
func loadRemoteImage(
|
||||
@ -68,11 +69,13 @@ extension UIImageView {
|
||||
kf.cancelDownloadTask()
|
||||
}
|
||||
|
||||
/// 规范化dURLString格式。
|
||||
private func normalizedURLString(from urlString: String?) -> String? {
|
||||
let text = urlString?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||
return text.isEmpty ? nil : text
|
||||
}
|
||||
|
||||
/// avatarPlaceholder相关逻辑。
|
||||
private static func avatarPlaceholder(
|
||||
systemImageName: String,
|
||||
iconSize: CGFloat,
|
||||
@ -98,6 +101,7 @@ extension UIImageView {
|
||||
}
|
||||
}
|
||||
|
||||
/// `UIImageView` 头像圆角辅助扩展。
|
||||
extension UIImageView {
|
||||
/// 在布局变化后刷新圆形头像圆角。
|
||||
func refreshRemoteAvatarCornerRadius() {
|
||||
|
||||
@ -23,6 +23,7 @@ private final class ViewModelBindingToken {
|
||||
private weak var owner: AnyObject?
|
||||
private let handler: () -> Void
|
||||
|
||||
/// 初始化实例。
|
||||
init(owner: AnyObject, handler: @escaping () -> Void) {
|
||||
self.owner = owner
|
||||
self.handler = handler
|
||||
@ -33,17 +34,22 @@ private final class ViewModelBindingToken {
|
||||
}
|
||||
}
|
||||
|
||||
/// `UIViewController` 通用 UI 与全局反馈扩展。
|
||||
extension UIViewController {
|
||||
/// 全局依赖容器快捷访问。
|
||||
var appServices: AppServices { AppServices.shared }
|
||||
|
||||
/// 展示全局 Toast 提示。
|
||||
func showToast(_ message: String) {
|
||||
appServices.toastCenter.show(message)
|
||||
}
|
||||
|
||||
/// 展示全局 Loading 遮罩。
|
||||
func showGlobalLoading(_ message: String = "") {
|
||||
appServices.globalLoading.show(message: message)
|
||||
}
|
||||
|
||||
/// 隐藏GlobalLoading。
|
||||
func hideGlobalLoading() {
|
||||
appServices.globalLoading.hide()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user