增加注解

This commit is contained in:
JinJiangHuang
2026-03-01 22:23:38 +08:00
parent 99a8cc799b
commit ee8c71dcd4
23 changed files with 374 additions and 24 deletions
+11
View File
@@ -2,15 +2,21 @@ import SwiftUI
/// - Android HomeActivity TabView
struct ContentView: View {
/// 使
private enum ApiInputTarget {
case vod
case live
}
///
@EnvironmentObject var appState: AppState
/// ViewModel
@StateObject private var settingsVM = SettingsViewModel()
///
@State private var selectedTab = 0
/// `appState.isConfigLoaded`
@State private var showSetup = false
///
@State private var setupInputTarget: ApiInputTarget = .vod
var body: some View {
@@ -29,6 +35,7 @@ struct ContentView: View {
let savedVodUrl = defaults.string(forKey: HawkConfig.API_URL) ?? ""
let savedLiveUrl = defaults.string(forKey: HawkConfig.LIVE_API_URL) ?? ""
if !savedVodUrl.isEmpty {
//
Task {
await appState.loadConfig(vodUrl: savedVodUrl, liveUrl: savedLiveUrl)
}
@@ -38,6 +45,7 @@ struct ContentView: View {
@ViewBuilder
private var multiRepoSelectionOverlay: some View {
//
if let pending = settingsVM.pendingMultiRepoSelection {
SelectionModal(
title: "选择\(pending.target.title)仓库",
@@ -62,6 +70,7 @@ struct ContentView: View {
// MARK: -
/// iOS 使 TabViewmacOS 使 NavigationSplitView
private var mainTabView: some View {
#if os(iOS)
TabView(selection: $selectedTab) {
@@ -130,6 +139,7 @@ struct ContentView: View {
// MARK: -
///
private var setupView: some View {
ZStack {
//
@@ -346,6 +356,7 @@ struct ContentView: View {
#if os(iOS)
UIPasteboard.general.string
#else
// macOS NSPasteboard
NSPasteboard.general.string(forType: .string)
#endif
}