     
     override func viewDidLoad() {
         super.viewDidLoad()
+        
         // Do any additional setup after loading the view, typically from a nib.
         
-        chartView = SCIChartSurfaceView(frame: self.view.bounds)
-        chartView?.translatesAutoresizingMaskIntoConstraints = true
+        sciChartSurface = SCIChartSurface(frame: self.view.bounds)
+        sciChartSurface?.translatesAutoresizingMaskIntoConstraints = true
         
-        if let chartSurfaceView = chartView {
-            self.view.addSubview(chartSurfaceView)
-            
-            chartSurface = SCIChartSurface(view: chartSurfaceView)
-            
-            chartSurface?.xAxes.add(SCINumericAxis())
-            chartSurface?.yAxes.add(SCINumericAxis())
-            
-            createDataSeries()
-            createRenderableSeries()
-            
-            chartSurface?.invalidateElement()
-        }
+        self.view.addSubview(sciChartSurface!)
+        
+        sciChartSurface?.xAxes.add(SCINumericAxis())
+        sciChartSurface?.yAxes.add(SCINumericAxis())
+        
+        createDataSeries()
+        createRenderableSeries()
+        
+        sciChartSurface?.invalidateElement()
+
     }
     
     func createDataSeries(){
         // Init line data series
-        lineDataSeries = SCIXyDataSeries(xType: .int16, yType: .int16, seriesType: .defaultType)
+        lineDataSeries = SCIXyDataSeries(xType: .int16, yType: .int16)
         for i in 0..<10{
             lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(i*2))
         }
         
         // Init scatter data series
-        scatterDataSeries = SCIXyDataSeries(xType: .int16, yType: .int16, seriesType: .defaultType)
+        scatterDataSeries = SCIXyDataSeries(xType: .int16, yType: .int16)
         for i in 0..<10{
             scatterDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(i*2 - i))
         }

        scatterRenderableSeries = SCIXyScatterRenderableSeries()
        scatterRenderableSeries.dataSeries = scatterDataSeries
        
        chartSurface?.renderableSeries.add(lineRenderableSeries)
        chartSurface?.renderableSeries.add(scatterRenderableSeries)
    }
}


class ViewController: UIViewController {
    
    var sciChartSurface: SCIChartSurface?
    
    var lineDataSeries: SCIXyDataSeries!
    var scatterDataSeries: SCIXyDataSeries!
