2

I am an old time Windows Visual Studio programmer trying to learn programming on the MAC with Xcode 10. I am trying to build a test program which uses Daniel Gindi's Charts. I start by creating a Coccoa Mac OS project called "test" and save it as workspace called "Mytest". I close the 'test' project and open the "Mytest" workspace. After downloading the current version(3.2.0) of Charts on GitHub and unzip it to the desktop, I open Charts directory and find Charts.xcodeproj. I drag that file into the workspace just above test. Next I click on test and find the "Embedded Binaries" section and click on the "+", select the "Charts.frameworkMacOS" and click Add.

Command B to build and get a Succeeded message.

I then select main.storyboard, then view under ViewController. I am able to add both a button and a text field to the view from the Objects Library.
This is where I am stuck. How to I add a LineChartView object? It is not in selection list.

This is probably very obvious to many but being new to this environment it has me stumped and frustrated.

Thank you in advance for your help!

matt
  • 515,959
  • 87
  • 875
  • 1,141
coop
  • 31
  • 1

1 Answers1

0

Your expectation is just wrong, that’s all. Xcode has no provision for injecting additional view types into the Object library. It knows nothing of LineChartView as far as the library is concerned.

However, it does know that there is an NSView subclass called LineChartView. So, just drag in a plain vanilla NSView and use the Identity inspector to turn that view into a LineChartView.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • The same answer is also in this tutorial: https://medium.com/@OsianSmith/creating-a-line-chart-in-swift-3-and-ios-10-2f647c95392e Might still be useful to study. – matt Sep 25 '18 at 18:32
  • Thank You for your help... Off to the next problem. ;) – coop Sep 25 '18 at 18:50