Skip to content

Commit

Permalink
fix 兼容问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ming1016 committed Nov 18, 2024
1 parent 48ac22d commit 4545d36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SwiftPamphletApp/App/SwiftPamphletAppApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import AppIntents

@main
struct SwiftPamphletAppApp: App {
@State private var metricsManager = MetricsManager()

// 启动时间打点
private let launchStartTime = DispatchTime.now()
private let signpostID = OSSignpostID(log: OSLog.default)
Expand All @@ -26,6 +26,7 @@ struct SwiftPamphletAppApp: App {
#if os(macOS)
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
#elseif os(iOS)
@State private var metricsManager = MetricsManager()
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
#endif

Expand Down Expand Up @@ -70,8 +71,8 @@ struct SwiftPamphletAppApp: App {
}

// 任务示例
TaskCase.bad()
// TaskCase.good()
// TaskCase.bad()
TaskCase.good()

// 任务管理器示例
// taskgroupDemo()
Expand Down
1 change: 1 addition & 0 deletions SwiftPamphletApp/Guide/View/GuideListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct GuideListView: View {
@State var listModel = GuideListModel()
@State private var limit: Int = 50
@State private var trigger = false // 触发列表书签状态更新

var body: some View {
if listModel.searchText.isEmpty == false {
HStack {
Expand Down
2 changes: 2 additions & 0 deletions SwiftPamphletApp/Performance/MetricManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Created by Ming on 2024/11/11.
//

#if os(iOS)
import MetricKit
import Observation

Expand Down Expand Up @@ -48,3 +49,4 @@ extension MetricsManager {
}.value
}
}
#endif

0 comments on commit 4545d36

Please sign in to comment.