Skip to content

Commit c116f97

Browse files
committed
merge from master
1 parent bbcb7c0 commit c116f97

File tree

143 files changed

+4654
-4570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+4654
-4570
lines changed

ChartsDemo-OSX/ChartsDemo-OSX.xcodeproj/project.pbxproj

+11-3
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,12 @@
175175
isa = PBXProject;
176176
attributes = {
177177
LastSwiftUpdateCheck = 0720;
178-
LastUpgradeCheck = 0720;
178+
LastUpgradeCheck = 0800;
179179
ORGANIZATIONNAME = dcg;
180180
TargetAttributes = {
181181
65B3F63D1C73B4F5000983D0 = {
182182
CreatedOnToolsVersion = 7.2.1;
183+
LastSwiftMigration = 0800;
183184
};
184185
};
185186
};
@@ -298,8 +299,10 @@
298299
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
299300
CLANG_WARN_EMPTY_BODY = YES;
300301
CLANG_WARN_ENUM_CONVERSION = YES;
302+
CLANG_WARN_INFINITE_RECURSION = YES;
301303
CLANG_WARN_INT_CONVERSION = YES;
302304
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
305+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
303306
CLANG_WARN_UNREACHABLE_CODE = YES;
304307
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
305308
CODE_SIGN_IDENTITY = "-";
@@ -342,8 +345,10 @@
342345
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
343346
CLANG_WARN_EMPTY_BODY = YES;
344347
CLANG_WARN_ENUM_CONVERSION = YES;
348+
CLANG_WARN_INFINITE_RECURSION = YES;
345349
CLANG_WARN_INT_CONVERSION = YES;
346350
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
351+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
347352
CLANG_WARN_UNREACHABLE_CODE = YES;
348353
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
349354
CODE_SIGN_IDENTITY = "-";
@@ -362,32 +367,35 @@
362367
MACOSX_DEPLOYMENT_TARGET = 10.11;
363368
MTL_ENABLE_DEBUG_INFO = NO;
364369
SDKROOT = macosx;
370+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
365371
};
366372
name = Release;
367373
};
368374
65B3F64E1C73B4F5000983D0 /* Debug */ = {
369375
isa = XCBuildConfiguration;
370376
buildSettings = {
377+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
371378
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
372379
COMBINE_HIDPI_IMAGES = YES;
373-
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
374380
INFOPLIST_FILE = "ChartsDemo-OSX/Info.plist";
375381
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
376382
PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.ChartsDemo-OSX";
377383
PRODUCT_NAME = "$(TARGET_NAME)";
384+
SWIFT_VERSION = 3.0;
378385
};
379386
name = Debug;
380387
};
381388
65B3F64F1C73B4F5000983D0 /* Release */ = {
382389
isa = XCBuildConfiguration;
383390
buildSettings = {
391+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
384392
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
385393
COMBINE_HIDPI_IMAGES = YES;
386-
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
387394
INFOPLIST_FILE = "ChartsDemo-OSX/Info.plist";
388395
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
389396
PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.ChartsDemo-OSX";
390397
PRODUCT_NAME = "$(TARGET_NAME)";
398+
SWIFT_VERSION = 3.0;
391399
};
392400
name = Release;
393401
};

ChartsDemo-OSX/ChartsDemo-OSX/Demos/BarDemoViewController.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,53 @@ import Foundation
1212
import Cocoa
1313
import Charts
1414

15-
public class BarDemoViewController: NSViewController
15+
open class BarDemoViewController: NSViewController
1616
{
1717
@IBOutlet var barChartView: BarChartView!
1818

19-
override public func viewDidLoad()
19+
override open func viewDidLoad()
2020
{
2121
super.viewDidLoad()
2222

2323
// Do any additional setup after loading the view.
2424
let ys1 = Array(1..<10).map { x in return sin(Double(x) / 2.0 / 3.141 * 1.5) }
2525
let ys2 = Array(1..<10).map { x in return cos(Double(x) / 2.0 / 3.141) }
2626

27-
let yse1 = ys1.enumerate().map { x, y in return BarChartDataEntry(x: Double(x), y: y) }
28-
let yse2 = ys2.enumerate().map { x, y in return BarChartDataEntry(x: Double(x), y: y) }
27+
let yse1 = ys1.enumerated().map { x, y in return BarChartDataEntry(x: Double(x), y: y) }
28+
let yse2 = ys2.enumerated().map { x, y in return BarChartDataEntry(x: Double(x), y: y) }
2929

3030
let data = BarChartData()
3131
let ds1 = BarChartDataSet(values: yse1, label: "Hello")
32-
ds1.colors = [NSUIColor.redColor()]
32+
ds1.colors = [NSUIColor.red]
3333
data.addDataSet(ds1)
3434

3535
let ds2 = BarChartDataSet(values: yse2, label: "World")
36-
ds2.colors = [NSUIColor.blueColor()]
36+
ds2.colors = [NSUIColor.blue]
3737
data.addDataSet(ds2)
3838
self.barChartView.data = data
3939

40-
self.barChartView.gridBackgroundColor = NSUIColor.whiteColor()
40+
self.barChartView.gridBackgroundColor = NSUIColor.white
4141

4242
self.barChartView.descriptionText = "Barchart Demo"
4343
}
4444

45-
@IBAction func save(sender: AnyObject)
45+
@IBAction func save(_ sender: AnyObject)
4646
{
4747
let panel = NSSavePanel()
4848
panel.allowedFileTypes = ["png"]
49-
panel.beginSheetModalForWindow(self.view.window!) { (result) -> Void in
49+
panel.beginSheetModal(for: self.view.window!) { (result) -> Void in
5050
if result == NSFileHandlingPanelOKButton
5151
{
52-
if let path = panel.URL?.path
52+
if let path = panel.url?.path
5353
{
54-
self.barChartView.saveToPath(path, format: .PNG, compressionQuality: 1.0)
54+
let _ = self.barChartView.save(to: path, format: .png, compressionQuality: 1.0)
5555
}
5656
}
5757
}
5858
}
5959

60-
override public func viewWillAppear()
60+
override open func viewWillAppear()
6161
{
6262
self.barChartView.animate(xAxisDuration: 1.0, yAxisDuration: 1.0)
6363
}
64-
}
64+
}

ChartsDemo-OSX/ChartsDemo-OSX/Demos/LineDemoViewController.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,38 @@ import Foundation
1212
import Cocoa
1313
import Charts
1414

15-
public class LineDemoViewController: NSViewController
15+
open class LineDemoViewController: NSViewController
1616
{
1717
@IBOutlet var lineChartView: LineChartView!
1818

19-
override public func viewDidLoad()
19+
override open func viewDidLoad()
2020
{
2121
super.viewDidLoad()
2222

2323
// Do any additional setup after loading the view.
2424
let ys1 = Array(1..<10).map { x in return sin(Double(x) / 2.0 / 3.141 * 1.5) }
2525
let ys2 = Array(1..<10).map { x in return cos(Double(x) / 2.0 / 3.141) }
2626

27-
let yse1 = ys1.enumerate().map { x, y in return ChartDataEntry(x: Double(x), y: y) }
28-
let yse2 = ys2.enumerate().map { x, y in return ChartDataEntry(x: Double(x), y: y) }
27+
let yse1 = ys1.enumerated().map { x, y in return ChartDataEntry(x: Double(x), y: y) }
28+
let yse2 = ys2.enumerated().map { x, y in return ChartDataEntry(x: Double(x), y: y) }
2929

3030
let data = LineChartData()
3131
let ds1 = LineChartDataSet(values: yse1, label: "Hello")
32-
ds1.colors = [NSUIColor.redColor()]
32+
ds1.colors = [NSUIColor.red]
3333
data.addDataSet(ds1)
3434

3535
let ds2 = LineChartDataSet(values: yse2, label: "World")
36-
ds2.colors = [NSUIColor.blueColor()]
36+
ds2.colors = [NSUIColor.blue]
3737
data.addDataSet(ds2)
3838
self.lineChartView.data = data
3939

40-
self.lineChartView.gridBackgroundColor = NSUIColor.whiteColor()
40+
self.lineChartView.gridBackgroundColor = NSUIColor.white
4141

4242
self.lineChartView.descriptionText = "Linechart Demo"
4343
}
4444

45-
override public func viewWillAppear()
45+
override open func viewWillAppear()
4646
{
4747
self.lineChartView.animate(xAxisDuration: 0.0, yAxisDuration: 1.0)
4848
}
49-
}
49+
}

ChartsDemo-OSX/ChartsDemo-OSX/Demos/PieDemoViewController.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ import Foundation
1212
import Cocoa
1313
import Charts
1414

15-
public class PieDemoViewController: NSViewController
15+
open class PieDemoViewController: NSViewController
1616
{
1717
@IBOutlet var pieChartView: PieChartView!
1818

19-
override public func viewDidLoad()
19+
override open func viewDidLoad()
2020
{
2121
super.viewDidLoad()
2222

2323
// Do any additional setup after loading the view.
2424
let ys1 = Array(1..<10).map { x in return sin(Double(x) / 2.0 / 3.141 * 1.5) * 100.0 }
2525

26-
let yse1 = ys1.enumerate().map { x, y in return PieChartDataEntry(value: y, label: String(x)) }
26+
let yse1 = ys1.enumerated().map { x, y in return PieChartDataEntry(value: y, label: String(x)) }
2727

2828
let data = PieChartData()
2929
let ds1 = PieChartDataSet(values: yse1, label: "Hello")
@@ -32,12 +32,12 @@ public class PieDemoViewController: NSViewController
3232

3333
data.addDataSet(ds1)
3434

35-
let paragraphStyle: NSMutableParagraphStyle = NSParagraphStyle.defaultParagraphStyle().mutableCopy() as! NSMutableParagraphStyle
36-
paragraphStyle.lineBreakMode = .ByTruncatingTail
37-
paragraphStyle.alignment = .Center
35+
let paragraphStyle: NSMutableParagraphStyle = NSParagraphStyle.default().mutableCopy() as! NSMutableParagraphStyle
36+
paragraphStyle.lineBreakMode = .byTruncatingTail
37+
paragraphStyle.alignment = .center
3838
let centerText: NSMutableAttributedString = NSMutableAttributedString(string: "Charts\nby Daniel Cohen Gindi")
3939
centerText.setAttributes([NSFontAttributeName: NSFont(name: "HelveticaNeue-Light", size: 15.0)!, NSParagraphStyleAttributeName: paragraphStyle], range: NSMakeRange(0, centerText.length))
40-
centerText.addAttributes([NSFontAttributeName: NSFont(name: "HelveticaNeue-Light", size: 13.0)!, NSForegroundColorAttributeName: NSColor.grayColor()], range: NSMakeRange(10, centerText.length - 10))
40+
centerText.addAttributes([NSFontAttributeName: NSFont(name: "HelveticaNeue-Light", size: 13.0)!, NSForegroundColorAttributeName: NSColor.gray], range: NSMakeRange(10, centerText.length - 10))
4141
centerText.addAttributes([NSFontAttributeName: NSFont(name: "HelveticaNeue-LightItalic", size: 13.0)!, NSForegroundColorAttributeName: NSColor(red: 51 / 255.0, green: 181 / 255.0, blue: 229 / 255.0, alpha: 1.0)], range: NSMakeRange(centerText.length - 19, 19))
4242

4343
self.pieChartView.centerAttributedText = centerText
@@ -47,8 +47,8 @@ public class PieDemoViewController: NSViewController
4747
self.pieChartView.descriptionText = "Piechart Demo"
4848
}
4949

50-
override public func viewWillAppear()
50+
override open func viewWillAppear()
5151
{
5252
self.pieChartView.animate(xAxisDuration: 0.0, yAxisDuration: 1.0)
5353
}
54-
}
54+
}

ChartsDemo-OSX/ChartsDemo-OSX/Demos/RadarDemoViewController.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,36 @@ import Foundation
1212
import Cocoa
1313
import Charts
1414

15-
public class RadarDemoViewController: NSViewController
15+
open class RadarDemoViewController: NSViewController
1616
{
1717
@IBOutlet var radarChartView: RadarChartView!
1818

19-
override public func viewDidLoad()
19+
override open func viewDidLoad()
2020
{
2121
super.viewDidLoad()
2222

2323
// Do any additional setup after loading the view.
2424
let ys1 = Array(1..<10).map { x in return sin(Double(x) / 2.0 / 3.141 * 1.5) }
2525
let ys2 = Array(1..<10).map { x in return cos(Double(x) / 2.0 / 3.141) }
2626

27-
let yse1 = ys1.enumerate().map { x, y in return RadarChartDataEntry(value: y) }
28-
let yse2 = ys2.enumerate().map { x, y in return RadarChartDataEntry(value: y) }
27+
let yse1 = ys1.enumerated().map { x, y in return RadarChartDataEntry(value: y) }
28+
let yse2 = ys2.enumerated().map { x, y in return RadarChartDataEntry(value: y) }
2929

3030
let data = RadarChartData()
3131
let ds1 = RadarChartDataSet(values: yse1, label: "Hello")
32-
ds1.colors = [NSUIColor.redColor()]
32+
ds1.colors = [NSUIColor.red]
3333
data.addDataSet(ds1)
3434

3535
let ds2 = RadarChartDataSet(values: yse2, label: "World")
36-
ds2.colors = [NSUIColor.blueColor()]
36+
ds2.colors = [NSUIColor.blue]
3737
data.addDataSet(ds2)
3838
self.radarChartView.data = data
3939
self.radarChartView.descriptionText = "Radarchart Demo"
4040

4141
}
4242

43-
override public func viewWillAppear()
43+
override open func viewWillAppear()
4444
{
4545
self.radarChartView.animate(xAxisDuration: 0.0, yAxisDuration: 1.0)
4646
}
47-
}
47+
}

0 commit comments

Comments
 (0)