增加注解

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 -1
View File
@@ -4,12 +4,19 @@ import SwiftUI
/// ViewModel
@MainActor
class LiveViewModel: ObservableObject {
///
@Published var channelGroups: [LiveChannelGroup] = []
///
@Published var selectedGroupIndex: Int = 0
///
@Published var selectedChannelIndex: Int = 0
///
@Published var currentChannel: LiveChannelItem?
///
@Published var epgList: [Epginfo] = []
/// 便 EPG
@Published var isLoading = false
/// TV
@Published var showChannelList = false
///
@@ -67,6 +74,7 @@ class LiveViewModel: ObservableObject {
/// 线
func switchSource() {
// `currentChannel` mutating @Published
currentChannel?.nextSource()
}
@@ -78,13 +86,15 @@ class LiveViewModel: ObservableObject {
/// EPG
private func loadEPG(for channel: LiveChannelItem) {
// EPG -
// / ID EPG
//
epgList = []
}
}
// 访
extension Collection {
/// `nil`
subscript(safe index: Index) -> Element? {
indices.contains(index) ? self[index] : nil
}