Skip to content

Commit

Permalink
Add Catalyst support
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Sep 11, 2022
1 parent 5128084 commit 4d31797
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Sources/Pulse/Helpers/LoggerSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Copyright (c) 2020–2022 Alexander Grebenyuk (github.com/kean).

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
import Foundation
#else
@preconcurrency import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pulse/LoggerStore/LoggerStore+Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Copyright (c) 2020–2022 Alexander Grebenyuk (github.com/kean).

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
import Foundation
#else
@preconcurrency import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pulse/LoggerStore/LoggerStore+Info.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Copyright (c) 2020–2022 Alexander Grebenyuk (github.com/kean).

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
import Foundation
#else
@preconcurrency import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pulse/NetworkLogger/NetworkLogger+Entities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Copyright (c) 2020–2022 Alexander Grebenyuk (github.com/kean).

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
import Foundation
#else
@preconcurrency import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pulse/NetworkLogger/NetworkLoggerInsights.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Copyright (c) 2020–2022 Alexander Grebenyuk (github.com/kean).

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
import Foundation
#else
@preconcurrency import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/PulseUI/Extensions/SwiftUIExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ extension Backport {

@ViewBuilder
func contextMenu<M: View, P: View>(@ViewBuilder menuItems: () -> M, @ViewBuilder preview: () -> P) -> some View {
#if swift(>=5.7) && !os(watchOS)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7) && !os(watchOS)
if #available(iOS 16.0, tvOS 16.0, macOS 13.0, *) {
self.content.contextMenu(menuItems: menuItems, preview: preview)
} else {
Expand Down
4 changes: 2 additions & 2 deletions Sources/PulseUI/Features/Charts/LoggerStoreSizeChart.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import SwiftUI
import Pulse

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
import Charts
#endif

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
@available(iOS 16.0, tvOS 16.0, macOS 13.0, watchOS 9.0, *)
struct LoggerStoreSizeChart: View {
let info: LoggerStore.Info
Expand Down
6 changes: 3 additions & 3 deletions Sources/PulseUI/Features/Insights/InsightsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Pulse
import SwiftUI
import CoreData

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
import Charts
#endif

Expand Down Expand Up @@ -59,7 +59,7 @@ public struct InsightsView: View {

@ViewBuilder
private var durationChart: some View {
#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
if #available(iOS 16.0, *) {
if insights.duration.values.isEmpty {
Text("No network requests yet")
Expand Down Expand Up @@ -186,7 +186,7 @@ final class InsightsViewModel: ObservableObject {
return "\(DurationFormatter.string(from: min, isPrecise: false))\(DurationFormatter.string(from: max, isPrecise: false))"
}

#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
@available(iOS 16.0, *)
struct Bar: Identifiable {
var id: Int { index }
Expand Down
2 changes: 1 addition & 1 deletion Sources/PulseUI/Features/Settings/StoreDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private struct Contents: View {
@ViewBuilder
private var form: some View {
Form {
#if swift(>=5.7)
#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
if #available(iOS 16.0, tvOS 16.0, macOS 13.0, watchOS 9.0, *), let info = viewModel.info {
LoggerStoreSizeChart(info: info, sizeLimit: viewModel.storeSizeLimit)
#if os(macOS)
Expand Down

0 comments on commit 4d31797

Please sign in to comment.