Charts: Unable to compile with Swift Package Manager due to missing dependencies

Created on 7 Jun 2019  Â·  13Comments  Â·  Source: danielgindi/Charts

ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.

Per our *CONTRIBUTING guidelines, we use GitHub for
bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag ios-charts.

Please remove this line and everything above it before submitting.

What did you do?

  1. Clone the project
  2. cd to working directory
  3. Run swift build
  4. Compile failure due to multiple missing reference frameworks

What did you expect to happen?

Compilation successful for all supported platforms

What happened instead?

Compilation failed for all platforms. Log attached.

Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin19.0.0
[1/2] Compiling Swift Module 'Charts' (136 sources)
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/YAxis.swift:73:36: error: use of undeclared type 'NSTextAlignment'
    @objc open var labelAlignment: NSTextAlignment = .left
                                   ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/YAxis.swift:73:36: error: use of undeclared type 'NSTextAlignment'
    @objc open var labelAlignment: NSTextAlignment = .left
                                   ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:606:49: error: use of undeclared type 'NSEvent'
    open override func mouseDown(with theEvent: NSEvent)
                                                ^~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift:63:22: error: use of unresolved identifier 'CACurrentMediaTime'
        _startTime = CACurrentMediaTime()
                     ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift:105:41: error: use of unresolved identifier 'CACurrentMediaTime'
        let currentTime: TimeInterval = CACurrentMediaTime()
                                        ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/BarChartRenderer.swift:736:119: error: use of undeclared type 'NSTextAlignment'
    @objc open func drawValue(context: CGContext, value: String, xPos: CGFloat, yPos: CGFloat, font: NSUIFont, align: NSTextAlignment, color: NSUIColor)
                                                                                                                      ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift:25:21: error: property cannot be marked @objc because its type cannot be represented in Objective-C
    @objc final var accessibleChartElements: [NSUIAccessibilityElement] = []
                    ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:159:87: error: use of undeclared type 'NSTextAlignment'
    open class func drawText(context: CGContext, text: String, point: CGPoint, align: NSTextAlignment, attributes: [NSAttributedString.Key : Any]?)
                                                                                      ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:107:38: error: use of undeclared type 'NSAccessibilityElement'
open class NSUIAccessibilityElement: NSAccessibilityElement
                                     ^~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift:77:25: error: method cannot be marked @objc because its result type cannot be represented in Objective-C
    @objc internal func createAccessibleHeader(usingChart chart: ChartViewBase,
                        ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift:79:105: note: classes not annotated with @objc cannot be represented in Objective-C
                                        withDefaultDescription defaultDescription: String = "Chart") -> NSUIAccessibilityElement
                                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift:324:29: error: use of unresolved identifier 'NSTextAlignment'; did you mean 'CTTextAlignment'?
            let textAlign = NSTextAlignment.left
                            ^~~~~~~~~~~~~~~
                            CTTextAlignment
CoreText.CTTextAlignment:1:13: note: 'CTTextAlignment' declared here
public enum CTTextAlignment : UInt8 {
            ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift:25:21: error: property cannot be marked @objc because its type cannot be represented in Objective-C
    @objc final var accessibleChartElements: [NSUIAccessibilityElement] = []
                    ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:107:38: error: use of undeclared type 'NSAccessibilityElement'
open class NSUIAccessibilityElement: NSAccessibilityElement
                                     ^~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:397:32: error: use of undeclared type 'NSTextAlignment'
                    var align: NSTextAlignment
                               ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:159:87: error: use of undeclared type 'NSTextAlignment'
    open class func drawText(context: CGContext, text: String, point: CGPoint, align: NSTextAlignment, attributes: [NSAttributedString.Key : Any]?)
                                                                                      ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:675:51: error: 'boundingRect(with:options:context:)' is only available on OS X 10.11 or newer
            let textBounds = centerAttributedText.boundingRect(with: boundingRect.size, options: [.usesLineFragmentOrigin, .usesFontLeading, .truncatesLastVisibleLine], context: nil)
                                                  ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:675:51: note: add 'if #available' version check
            let textBounds = centerAttributedText.boundingRect(with: boundingRect.size, options: [.usesLineFragmentOrigin, .usesFontLeading, .truncatesLastVisibleLine], context: nil)
                                                  ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:647:18: note: add @available attribute to enclosing instance method
    private func drawCenterText(context: CGContext)
                 ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:15:12: note: add @available attribute to enclosing class
open class PieChartRenderer: DataRenderer
           ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:689:34: error: 'draw(with:options:context:)' is only available on OS X 10.11 or newer
            centerAttributedText.draw(with: drawingRect, options: [.usesLineFragmentOrigin, .usesFontLeading, .truncatesLastVisibleLine], context: nil)
                                 ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:689:34: note: add 'if #available' version check
            centerAttributedText.draw(with: drawingRect, options: [.usesLineFragmentOrigin, .usesFontLeading, .truncatesLastVisibleLine], context: nil)
                                 ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:647:18: note: add @available attribute to enclosing instance method
    private func drawCenterText(context: CGContext)
                 ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/PieChartRenderer.swift:15:12: note: add @available attribute to enclosing class
open class PieChartRenderer: DataRenderer
           ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift:77:25: error: method cannot be marked @objc because its result type cannot be represented in Objective-C
    @objc internal func createAccessibleHeader(usingChart chart: ChartViewBase,
                        ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift:79:105: note: classes not annotated with @objc cannot be represented in Objective-C
                                        withDefaultDescription defaultDescription: String = "Chart") -> NSUIAccessibilityElement
                                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:171:25: error: use of unresolved identifier 'NSParagraphStyle'; did you mean 'CTParagraphStyle'?
        let paraStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
                        ^~~~~~~~~~~~~~~~
                        CTParagraphStyle
CoreText.CTParagraphStyle:1:14: note: 'CTParagraphStyle' declared here
public class CTParagraphStyle : _CFObject {
             ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:221:45: error: 'boundingRect(with:options:attributes:context:)' is only available on OS X 10.11 or newer
                        let width = labelns.boundingRect(with: labelMaxSize, options: .usesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width
                                            ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:221:45: note: add 'if #available' version check
                        let width = labelns.boundingRect(with: labelMaxSize, options: .usesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width
                                            ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:164:21: note: add @available attribute to enclosing instance method
    @objc open func drawLabels(context: CGContext, pos: CGFloat, anchor: CGPoint)
                    ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:16:12: note: add @available attribute to enclosing class
open class XAxisRenderer: AxisRendererBase
           ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:231:45: error: 'boundingRect(with:options:attributes:context:)' is only available on OS X 10.11 or newer
                        let width = labelns.boundingRect(with: labelMaxSize, options: .usesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width
                                            ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:231:45: note: add 'if #available' version check
                        let width = labelns.boundingRect(with: labelMaxSize, options: .usesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width
                                            ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:164:21: note: add @available attribute to enclosing instance method
    @objc open func drawLabels(context: CGContext, pos: CGFloat, anchor: CGPoint)
                    ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:16:12: note: add @available attribute to enclosing class
open class XAxisRenderer: AxisRendererBase
           ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/XAxisRenderer.swift:401:39: error: use of undeclared type 'NSTextAlignment'
        let (point, align): (CGPoint, NSTextAlignment)
                                      ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/YAxisRenderer.swift:125:20: error: use of undeclared type 'NSTextAlignment'
        textAlign: NSTextAlignment)
                   ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/YAxisRenderer.swift:41:24: error: use of undeclared type 'NSTextAlignment'
        var textAlign: NSTextAlignment
                       ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift:181:24: error: use of undeclared type 'NSTextAlignment'
        let alignment: NSTextAlignment = yAxis.labelAlignment
                       ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:258:32: error: 'draw(with:options:attributes:context:)' is only available on OS X 10.11 or newer
            (text as NSString).draw(with: rect, options: .usesLineFragmentOrigin, attributes: attributes, context: nil)
                               ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:258:32: note: add 'if #available' version check
            (text as NSString).draw(with: rect, options: .usesLineFragmentOrigin, attributes: attributes, context: nil)
                               ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:231:25: note: add @available attribute to enclosing class method
    internal class func drawMultilineText(context: CGContext, text: String, knownTextSize: CGSize, point: CGPoint, attributes: [NSAttributedString.Key : Any]?, constrainedToSize: CGSize, anchor: CGPoint, angleRadians: CGFloat)
                        ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:112:12: note: add @available attribute to enclosing class
open class ChartUtils
           ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:273:32: error: 'draw(with:options:attributes:context:)' is only available on OS X 10.11 or newer
            (text as NSString).draw(with: rect, options: .usesLineFragmentOrigin, attributes: attributes, context: nil)
                               ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:273:32: note: add 'if #available' version check
            (text as NSString).draw(with: rect, options: .usesLineFragmentOrigin, attributes: attributes, context: nil)
                               ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:231:25: note: add @available attribute to enclosing class method
    internal class func drawMultilineText(context: CGContext, text: String, knownTextSize: CGSize, point: CGPoint, attributes: [NSAttributedString.Key : Any]?, constrainedToSize: CGSize, anchor: CGPoint, angleRadians: CGFloat)
                        ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:112:12: note: add @available attribute to enclosing class
open class ChartUtils
           ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:281:25: error: 'boundingRect(with:options:attributes:context:)' is only available on OS X 10.11 or newer
        let rect = text.boundingRect(with: constrainedToSize, options: .usesLineFragmentOrigin, attributes: attributes, context: nil)
                        ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:281:25: note: add 'if #available' version check
        let rect = text.boundingRect(with: constrainedToSize, options: .usesLineFragmentOrigin, attributes: attributes, context: nil)
                        ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:279:25: note: add @available attribute to enclosing class method
    internal class func drawMultilineText(context: CGContext, text: String, point: CGPoint, attributes: [NSAttributedString.Key : Any]?, constrainedToSize: CGSize, anchor: CGPoint, angleRadians: CGFloat)
                        ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:112:12: note: add @available attribute to enclosing class
open class ChartUtils
           ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:109:37: error: use of undeclared type 'NSView'
    private weak var containerView: NSView?
                                    ^~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:184:21: error: use of undeclared type 'NSAccessibilityGroup'
extension NSUIView: NSAccessibilityGroup
                    ^~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:98:5: error: use of unresolved identifier 'NSAccessibility'
    NSAccessibility.post(element: validElement, notification: .layoutChanged)
    ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:115:13: error: use of unresolved identifier 'setAccessibilityRole'
            setAccessibilityRole(isHeader ? .staticText : .none)
            ^~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:123:13: error: use of unresolved identifier 'setAccessibilitySelected'
            setAccessibilitySelected(isSelected)
            ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:131:38: error: cannot call value of non-function type 'String'
            return accessibilityLabel() ?? ""
                   ~~~~~~~~~~~~~~~~~~^~

/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:136:13: error: use of unresolved identifier 'setAccessibilityLabel'
            setAccessibilityLabel(newValue)
            ^~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:144:38: error: cannot call value of non-function type 'NSRect' (aka 'CGRect')
            return accessibilityFrame()
                   ~~~~~~~~~~~~~~~~~~^~

/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:151:26: error: use of unresolved identifier 'NSAccessibility'
            let bounds = NSAccessibility.screenRect(fromView: containerView, rect: newValue)
                         ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:159:13: error: use of unresolved identifier 'setAccessibilityFrameInParentSpace'
            setAccessibilityFrameInParentSpace(bounds)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:160:45: error: cannot call value of non-function type 'NSRect' (aka 'CGRect')
            let axFrame = accessibilityFrame()
                          ~~~~~~~~~~~~~~~~~~^~

/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:167:13: error: use of unresolved identifier 'setAccessibilityFrameInParentSpace'
            setAccessibilityFrameInParentSpace(rect)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:174:40: error: use of undeclared type 'NSView'
        containerView = (container as! NSView)
                                       ^~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:176:9: error: 'super' members cannot be referenced in a root class
        super.init()
        ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:178:9: error: use of unresolved identifier 'setAccessibilityParent'
        setAccessibilityParent(containerView)
        ^~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/Platform+Accessibility.swift:179:9: error: use of unresolved identifier 'setAccessibilityRole'
        setAccessibilityRole(.row)
        ^~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/ChartViewBase.swift:96:41: error: use of undeclared type 'NSTextAlignment'
    @objc open var noDataTextAlignment: NSTextAlignment = .left
                                        ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/ChartViewBase.swift:96:20: error: property cannot be marked @objc because its type cannot be represented in Objective-C
    @objc open var noDataTextAlignment: NSTextAlignment = .left
                   ^                    ~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:606:49: error: use of undeclared type 'NSEvent'
    open override func mouseDown(with theEvent: NSEvent)
                                                ^~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:624:52: error: use of undeclared type 'NSEvent'
    open override func mouseDragged(with theEvent: NSEvent)
                                                   ^~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:639:47: error: use of undeclared type 'NSEvent'
    open override func mouseUp(with theEvent: NSEvent)
                                              ^~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/Description.swift:39:31: error: use of undeclared type 'NSTextAlignment'
    @objc open var textAlign: NSTextAlignment = NSTextAlignment.right
                              ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/Description.swift:39:20: error: property cannot be marked @objc because its type cannot be represented in Objective-C
    @objc open var textAlign: NSTextAlignment = NSTextAlignment.right
                   ^          ~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/YAxis.swift:73:36: error: use of undeclared type 'NSTextAlignment'
    @objc open var labelAlignment: NSTextAlignment = .left
                                   ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/YAxis.swift:73:20: error: property cannot be marked @objc because its type cannot be represented in Objective-C
    @objc open var labelAlignment: NSTextAlignment = .left
                   ^               ~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/BarChartRenderer.swift:736:119: error: use of undeclared type 'NSTextAlignment'
    @objc open func drawValue(context: CGContext, value: String, xPos: CGFloat, yPos: CGFloat, font: NSUIFont, align: NSTextAlignment, color: NSUIColor)
                                                                                                                      ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Animation/Animator.swift:120:41: error: use of unresolved identifier 'CACurrentMediaTime'
        let currentTime: TimeInterval = CACurrentMediaTime()
                                        ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Animation/Animator.swift:145:23: error: use of unresolved identifier 'CACurrentMediaTime'
        _startTimeX = CACurrentMediaTime()
                      ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Animation/Animator.swift:213:23: error: use of unresolved identifier 'CACurrentMediaTime'
        _startTimeX = CACurrentMediaTime()
                      ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Animation/Animator.swift:251:23: error: use of unresolved identifier 'CACurrentMediaTime'
        _startTimeY = CACurrentMediaTime()
                      ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/BarLineChartViewBase.swift:917:65: error: use of undeclared type 'NSGestureRecognizer'
    public func gestureRecognizerShouldBegin(gestureRecognizer: NSGestureRecognizer) -> Bool
                                                                ^~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/ChartViewBase.swift:96:41: error: use of undeclared type 'NSTextAlignment'
    @objc open var noDataTextAlignment: NSTextAlignment = .left
                                        ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/BarLineChartViewBase.swift:774:45: error: use of unresolved identifier 'CACurrentMediaTime'
                    _decelerationLastTime = CACurrentMediaTime()
                                            ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/BarLineChartViewBase.swift:844:27: error: use of unresolved identifier 'CACurrentMediaTime'
        let currentTime = CACurrentMediaTime()
                          ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/ChartViewBase.swift:320:34: error: use of unresolved identifier 'NSMutableParagraphStyle'
            let paragraphStyle = NSMutableParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
                                 ^~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Utils/ChartUtils.swift:159:87: error: use of undeclared type 'NSTextAlignment'
    open class func drawText(context: CGContext, text: String, point: CGPoint, align: NSTextAlignment, attributes: [NSAttributedString.Key : Any]?)
                                                                                      ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/Description.swift:39:31: error: use of undeclared type 'NSTextAlignment'
    @objc open var textAlign: NSTextAlignment = NSTextAlignment.right
                              ^~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift:25:21: error: property cannot be marked @objc because its type cannot be represented in Objective-C
    @objc final var accessibleChartElements: [NSUIAccessibilityElement] = []
                    ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:606:49: error: use of undeclared type 'NSEvent'
    open override func mouseDown(with theEvent: NSEvent)
                                                ^~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:624:52: error: use of undeclared type 'NSEvent'
    open override func mouseDragged(with theEvent: NSEvent)
                                                   ^~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:639:47: error: use of undeclared type 'NSEvent'
    open override func mouseUp(with theEvent: NSEvent)
                                              ^~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieChartView.swift:352:38: error: use of unresolved identifier 'NSParagraphStyle'; did you mean 'CTParagraphStyle'?
                let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
                                     ^~~~~~~~~~~~~~~~
                                     CTParagraphStyle
CoreText.CTParagraphStyle:1:14: note: 'CTParagraphStyle' declared here
public class CTParagraphStyle : _CFObject {
             ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:606:24: error: method does not override any method from its superclass
    open override func mouseDown(with theEvent: NSEvent)
         ~~~~~~~~      ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:624:24: error: method does not override any method from its superclass
    open override func mouseDragged(with theEvent: NSEvent)
         ~~~~~~~~      ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:639:24: error: method does not override any method from its superclass
    open override func mouseUp(with theEvent: NSEvent)
         ~~~~~~~~      ^
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:529:41: error: use of unresolved identifier 'CACurrentMediaTime'
                _decelerationLastTime = CACurrentMediaTime()
                                        ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:668:24: error: use of unresolved identifier 'CACurrentMediaTime'
            let time = CACurrentMediaTime()
                       ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:749:27: error: use of unresolved identifier 'CACurrentMediaTime'
        let currentTime = CACurrentMediaTime()
                          ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift:829:45: error: use of unresolved identifier 'CACurrentMediaTime'
                    _decelerationLastTime = CACurrentMediaTime()
                                            ^~~~~~~~~~~~~~~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/MarkerView.swift:84:13: error: use of unresolved identifier 'NSNib'
            NSNib.Name(String(describing: self)),
            ^~~~~
/Users/rynecheow/Desktop/Charts/Source/Charts/Components/YAxis.swift:73:36: error: use of undeclared type 'NSTextAlignment'
    @objc open var labelAlignment: NSTextAlignment = .left
                                   ^~~~~~~~~~~~~~~

Charts Environment

Charts version/Branch/Commit Number: 3.3.0
Xcode version: 10.2.1
Swift version: 5.0
Platform(s) running Charts: macOS, iOS, tvOS
macOS version running Xcode: 10.14

Demo Project

Just download from 3.3.0 tag would do.

Most helpful comment

I'm facing this issue when integrating into Xcode 11.7 using SPM.
3.x works, 4.x doesn't

All 13 comments

This issue currently blocks the use of Charts as a package dependency in Xcode 11. Finally we have a dependency solution integrated into Xcode, so I would love to see some movement on this!

I'm having the same problem while trying to migrate from CocoaPods to SwiftPM so I'll guess I'll have to stick with CocoaPods.

I believe I have merged the SPM PR last week. #4017
btw, I still have to wait a few PRs get feedback about reviews in https://github.com/danielgindi/Charts/projects/9

until then I cannot push a new version for Xcode11. Either you grab the source code or wait.

I just converted a project to use Swift Package Manager instead of Cocoapods and I can confirm that your PR works as advertised. Thanks! 🎉

@5teveroy so you can let SPM use master branch, as well as a specific release? like 3.3.0?
I'm thinking releasing a new version, keep using the master branch should be fine, but most people would just pick an 'official release'

@5teveroy so you can let SPM use master branch, as well as a specific release? like 3.3.0?

Yes. Currently I pointed it to master but once you make a release I'll switch it to the version specification. It works similarly to how Cocoapods does it.

Screen Shot 2019-09-29 at 5 00 39 PM

ah, that's great it can do this. then stay tuned! thx

I'm facing this issue when integrating into Xcode 11.7 using SPM.
3.x works, 4.x doesn't

Hi. Is there a resolution to this issue?
I am now trying to switch from Pods to SPM and cannot build my project due to numerous builds errors in Charts.
I am using Xcode 12.3 and SPM points to master branch of Charts repo.
Lower versions of Charts also fail to build.
Charts build fail

Ok. figured out a couple of issues and now the build passes for me locally.

there are typos
- var interval = rawInterval.roundedToNextSignficant()
+ var interval = rawInterval.roundedToNextSignificant()

and missing imports of UIKit in 3 files (the root cause of "Cannot find type NSTextAlignment in scope")
not sure how to validate if my changes did not break anything but at least now I have a working build for Charts with SPM (latest master).
Will keep on testing a bit

@ArthurValiev I have the same issue, it would be great if you could open a PR with your fixes!

@bear24rw I've opened PR with my changes https://github.com/danielgindi/Charts/pull/4550
Will see how it goes with review/approval.

This issue seems to still be present

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kirti0525 picture kirti0525  Â·  3Comments

guoyutaog picture guoyutaog  Â·  3Comments

Bharati555 picture Bharati555  Â·  4Comments

heumn picture heumn  Â·  3Comments

ahmedsafadii picture ahmedsafadii  Â·  3Comments