Browse Source

Merge pull request #5041 from FelixHerrmann/master

Fix Xcode 14.3 import warnings
Pierre-Marc Airoldi 2 years ago
parent
commit
56b4f22fd1

+ 6 - 2
Source/Charts/Charts/ChartViewBase.swift

@@ -13,8 +13,12 @@
 import Foundation
 import CoreGraphics
 
-#if !os(OSX)
-    import UIKit
+#if canImport(UIKit)
+import UIKit
+#endif
+
+#if canImport(AppKit)
+import AppKit
 #endif
 
 @objc

+ 8 - 0
Source/Charts/Components/AxisBase.swift

@@ -12,6 +12,14 @@
 import Foundation
 import CoreGraphics
 
+#if canImport(UIKit)
+import UIKit
+#endif
+
+#if canImport(AppKit)
+import AppKit
+#endif
+
 /// Base class for all axes
 @objc(ChartAxisBase)
 open class AxisBase: ComponentBase

+ 7 - 0
Source/Charts/Components/ChartLimitLine.swift

@@ -12,6 +12,13 @@
 import Foundation
 import CoreGraphics
 
+#if canImport(UIKit)
+import UIKit
+#endif
+
+#if canImport(AppKit)
+import AppKit
+#endif
 
 /// The limit line is an additional feature for all Line, Bar and ScatterCharts.
 /// It allows the displaying of an additional line in the chart that marks a certain maximum / limit on the specified axis (x- or y-axis).

+ 8 - 0
Source/Charts/Components/Legend.swift

@@ -12,6 +12,14 @@
 import Foundation
 import CoreGraphics
 
+#if canImport(UIKit)
+import UIKit
+#endif
+
+#if canImport(AppKit)
+import AppKit
+#endif
+
 @objc(ChartLegend)
 open class Legend: ComponentBase
 {

+ 7 - 0
Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift

@@ -12,6 +12,13 @@
 import Foundation
 import CoreGraphics
 
+#if canImport(UIKit)
+import UIKit
+#endif
+
+#if canImport(AppKit)
+import AppKit
+#endif
 
 open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet, BarChartDataSetProtocol
 {