From dae30fc61ed509a600b6679a894fcff723badf29 Mon Sep 17 00:00:00 2001 From: Xuan Liu Date: Mon, 30 Mar 2020 11:06:45 +0800 Subject: [PATCH] fix macOS error. move to platform+Graphics for the extension --- Source/Charts/Utils/Platform+Graphics.swift | 15 +++++++++++++++ Source/Charts/Utils/Platform.swift | 20 -------------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/Source/Charts/Utils/Platform+Graphics.swift b/Source/Charts/Utils/Platform+Graphics.swift index 6a72426978..a8427a4fb6 100644 --- a/Source/Charts/Utils/Platform+Graphics.swift +++ b/Source/Charts/Utils/Platform+Graphics.swift @@ -9,6 +9,21 @@ // https://github.com/danielgindi/Charts // +enum Orientation +{ + case portrait, landscape +} + +extension CGSize +{ + var orientation: Orientation { return width > height ? .landscape : .portrait } +} + +extension CGRect +{ + var orientation: Orientation { size.orientation } +} + // MARK: - UIKit #if canImport(UIKit) import UIKit diff --git a/Source/Charts/Utils/Platform.swift b/Source/Charts/Utils/Platform.swift index 1511af5869..8605480548 100644 --- a/Source/Charts/Utils/Platform.swift +++ b/Source/Charts/Utils/Platform.swift @@ -39,26 +39,6 @@ extension UIScreen } } -enum Orientation -{ - case portrait, landscape -} - -extension CGSize -{ - var orientation: Orientation { return width > height ? .landscape : .portrait } -} - -extension CGRect -{ - var orientation: Orientation { size.orientation } -} - -func NSUIMainScreen() -> NSUIScreen? -{ - return NSUIScreen.main -} - #endif #if os(OSX)