From 5d4f8ac03c9f4e4f58d399881bdc2dd2d18902bf Mon Sep 17 00:00:00 2001 From: Matteo Gavagnin Date: Thu, 6 Apr 2017 21:37:45 +0200 Subject: [PATCH 1/2] Compatibility with swift playgrounds - Added missing import CoreGraphics where needed. - Added missing import UIKit where needed. --- Source/Charts/Components/Description.swift | 4 ++++ Source/Charts/Filters/DataApproximator.swift | 1 + Source/Charts/Highlight/Highlight.swift | 1 + .../Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift | 1 + Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift | 1 + Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift | 1 + Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift | 1 + Source/Charts/Renderers/Scatter/IShapeRenderer.swift | 1 + Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift | 1 + Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift | 1 + Source/Charts/Renderers/Scatter/XShapeRenderer.swift | 1 + 11 files changed, 14 insertions(+) diff --git a/Source/Charts/Components/Description.swift b/Source/Charts/Components/Description.swift index 67bdd509a1..a387d362a9 100644 --- a/Source/Charts/Components/Description.swift +++ b/Source/Charts/Components/Description.swift @@ -12,6 +12,10 @@ import Foundation import CoreGraphics +#if !os(OSX) + import UIKit +#endif + @objc(ChartDescription) open class Description: ComponentBase { diff --git a/Source/Charts/Filters/DataApproximator.swift b/Source/Charts/Filters/DataApproximator.swift index 608714a0a6..efaa55c1fc 100644 --- a/Source/Charts/Filters/DataApproximator.swift +++ b/Source/Charts/Filters/DataApproximator.swift @@ -10,6 +10,7 @@ // import Foundation +import CoreGraphics @objc(ChartDataApproximator) open class DataApproximator: NSObject diff --git a/Source/Charts/Highlight/Highlight.swift b/Source/Charts/Highlight/Highlight.swift index 3ef03a6d33..d5e6221910 100644 --- a/Source/Charts/Highlight/Highlight.swift +++ b/Source/Charts/Highlight/Highlight.swift @@ -10,6 +10,7 @@ // import Foundation +import CoreGraphics @objc(ChartHighlight) open class Highlight: NSObject diff --git a/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift b/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift index ef4d26ed2c..2d035bf357 100644 --- a/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // import Foundation +import CoreGraphics open class ChevronDownShapeRenderer : NSObject, IShapeRenderer { diff --git a/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift b/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift index a0b9f36c68..725533e780 100644 --- a/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // import Foundation +import CoreGraphics open class ChevronUpShapeRenderer : NSObject, IShapeRenderer { diff --git a/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift b/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift index ed8a25655b..b94a51137a 100644 --- a/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // import Foundation +import CoreGraphics open class CircleShapeRenderer : NSObject, IShapeRenderer { diff --git a/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift b/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift index 571ea1132f..18785d3dee 100644 --- a/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // import Foundation +import CoreGraphics open class CrossShapeRenderer : NSObject, IShapeRenderer { diff --git a/Source/Charts/Renderers/Scatter/IShapeRenderer.swift b/Source/Charts/Renderers/Scatter/IShapeRenderer.swift index 51578a99ba..f26dc6568b 100644 --- a/Source/Charts/Renderers/Scatter/IShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/IShapeRenderer.swift @@ -10,6 +10,7 @@ // import Foundation +import CoreGraphics @objc public protocol IShapeRenderer : NSObjectProtocol diff --git a/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift b/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift index 892068ff79..ea692e33fd 100644 --- a/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // import Foundation +import CoreGraphics open class SquareShapeRenderer : NSObject, IShapeRenderer { diff --git a/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift b/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift index 4847c00cde..fa313b765b 100644 --- a/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // import Foundation +import CoreGraphics open class TriangleShapeRenderer : NSObject, IShapeRenderer { diff --git a/Source/Charts/Renderers/Scatter/XShapeRenderer.swift b/Source/Charts/Renderers/Scatter/XShapeRenderer.swift index 1f8c617fbe..8a546c5f0b 100644 --- a/Source/Charts/Renderers/Scatter/XShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/XShapeRenderer.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // import Foundation +import CoreGraphics open class XShapeRenderer : NSObject, IShapeRenderer { From 409cebfb8bde357617a122829acf218c5b4e7ed9 Mon Sep 17 00:00:00 2001 From: Matteo Gavagnin Date: Fri, 7 Apr 2017 07:54:28 +0200 Subject: [PATCH 2/2] Added one last missing import CoreGraphics --- Source/Charts/Data/Interfaces/IChartDataSet.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Charts/Data/Interfaces/IChartDataSet.swift b/Source/Charts/Data/Interfaces/IChartDataSet.swift index 5cdb4bc9ed..293db393eb 100644 --- a/Source/Charts/Data/Interfaces/IChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/IChartDataSet.swift @@ -10,6 +10,7 @@ // import Foundation +import CoreGraphics @objc public protocol IChartDataSet