Skip to content

Commit

Permalink
fix macOS error. move to platform+Graphics for the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxuan30 committed Mar 30, 2020
1 parent 219e67e commit dae30fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
15 changes: 15 additions & 0 deletions Source/Charts/Utils/Platform+Graphics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 0 additions & 20 deletions Source/Charts/Utils/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dae30fc

Please sign in to comment.