iOS and Xamarin.iOS Charting Documentation - SciChart iOS Charts and Xamarin Charts SDK v2.x
Tutorial 01 - Linking SciChart Framework

Creating the Xcode project

In this tutorial series we will create a simple line chart using SciChart iOS. First, we need to create a new project and link SciChart framework.

If you have already created a project with linked SciChart framework, you can safely skip to Tutorial 02 - Creating a Simple Line Chart.

First, ensure you have downloaded and unzipped the SciChart iOS Trial package.

Next, create a new Xcode project selecting iOS Single View application template:

Linking the SciChart framework

We suggest you two ways of how you can do this. First one is with using CocoaPods dependency manager or reference the library from installation folder.

Linking framework with CocoaPods dependency manager

 Open up Terminal and run folowing command:

           sudo gem install cocoapods

Now, still in Terminal, navigate to the folder where you've created the Xcode project and run this command:

           pod init

This command creates a new file called Podfile in the folder - open this file via TextEdit and make it as in the following box:

Copy Code
source ''
platform :ios, '8.0'

target 'MyApp' do
  # Pods for MyApp
  pod 'SciChart'

Now, go back to the Terminal, which should be opened at your project's folder, and run 

      pod install command

This fetches the pod and adds it to your project.

Close the Xcode IDE and open the .xworkspace file in project's directory, which was created after our manipulations.

Once the new version of SciChart will be released you can easily update it with

       pod update

Latest SciChart version

We highly recommend you to run pod update  command right after you've installed it, to be sure you are using the latest SciChart version

Referencing from Installation Directory.

Now, let's link SciChart.framework file. To do this we need to add framwork file in "Embedded Binaries" section.
Follow these steps to do that:

Copy locacl option

You might have noticed the "Copy item local...". When you choose this option, the Xcode will copy the file you are adding locally. I don't want this to be happened you have to, first of all uncheck this option, and at second set the Frameworks Search Paths  property which you can find in Build Settings tab

Take a look at the following gif for a better understanding:



Important thing to check is that the linked scichart.framework file should be placed in both sections - "Embedded Binaries" and "Linked Frameworks and Libraries". Now your project has a link to SciChart framework.

Keep the framework file in the same folder

We suggest you to copy the framework file into your project's folder, and then link the framework file. This will help you to avoid the situation when you unintentionally moved or deleted the folder where the SciChart framework file was placed.

Adding SCIGenericWrapper.swift file

The final step, but one of the most important, is to add SCIGenericWrapper.swift to the Compile Sources section.
To do this, click on your project, then click on Build Phases tab and go to Compile Sources section. Click on "+" button. In selection dialog window click on the "Add Other..".
In the appeared popup go to the directory, where you saved the SciChart.framework file.
Double click on the framework file. Go to SwiftUtil folder and select SCIGenericWrapper file:



At this point the project should build and run, however we now need to add some data to be displayed as well as some basic functionality.