Skip to content

Commit fe93e08

Browse files
committed
Updated the Swift example apps with Swift 3.0 changes in Xcode 8 beta 4.
1 parent dcf3ef2 commit fe93e08

5 files changed

Lines changed: 19 additions & 5 deletions

File tree

examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@
249249
attributes = {
250250
LastSwiftUpdateCheck = 0700;
251251
LastUpgradeCheck = 0800;
252+
TargetAttributes = {
253+
1D6058900D05DD3D006BFB54 = {
254+
LastSwiftMigration = 0800;
255+
};
256+
};
252257
};
253258
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp-iPhone" */;
254259
compatibilityVersion = "Xcode 6.3";
@@ -394,6 +399,7 @@
394399
PRODUCT_NAME = "CPTTestApp-iPhone";
395400
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
396401
SWIFT_OBJC_BRIDGING_HEADER = "CPTTestApp-iPhone-Bridging-Header.h";
402+
SWIFT_VERSION = 3.0;
397403
USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**";
398404
};
399405
name = Debug;
@@ -422,6 +428,7 @@
422428
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
423429
SWIFT_OBJC_BRIDGING_HEADER = "CPTTestApp-iPhone-Bridging-Header.h";
424430
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
431+
SWIFT_VERSION = 3.0;
425432
USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**";
426433
};
427434
name = Release;

examples/CPTTestApp-iPhone/Classes/BarChartController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class BarChartController : UIViewController, CPTBarPlotDataSource {
4949
let titleRange1 = NSRange(location: 0, length: lineOne.utf16.count)
5050
let titleRange2 = NSRange(location: lineOne.utf16.count + 1, length: lineTwo.utf16.count)
5151

52-
graphTitle.addAttribute(NSForegroundColorAttributeName, value:UIColor.white(), range:titleRange1)
53-
graphTitle.addAttribute(NSForegroundColorAttributeName, value:UIColor.gray(), range:titleRange2)
52+
graphTitle.addAttribute(NSForegroundColorAttributeName, value:UIColor.white, range:titleRange1)
53+
graphTitle.addAttribute(NSForegroundColorAttributeName, value:UIColor.gray, range:titleRange2)
5454
graphTitle.addAttribute(NSParagraphStyleAttributeName, value:paragraphStyle, range:NSRange(location: 0, length: graphTitle.length))
5555
graphTitle.addAttribute(NSFontAttributeName, value:line1Font!, range:titleRange1)
5656
graphTitle.addAttribute(NSFontAttributeName, value:line2Font!, range:titleRange2)

examples/CPTTestApp-iPhone/Classes/PieChartController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class PieChartController : UIViewController, CPTPieChartDataSource, CPTPieChartD
8383
return label
8484
}
8585

86-
func radialOffsetForPieChart(piePlot: CPTPieChart, recordIndex: UInt) -> CGFloat
86+
func radialOffset(for piePlot: CPTPieChart, record recordIndex: UInt) -> CGFloat
8787
{
8888
var offset: CGFloat = 0.0
8989

@@ -96,7 +96,7 @@ class PieChartController : UIViewController, CPTPieChartDataSource, CPTPieChartD
9696

9797
// MARK: - Delegate Methods
9898

99-
private func pieChart(plot: CPTPlot, sliceWasSelectedAtRecordIndex recordIndex: UInt)
99+
private func pieChart(_ plot: CPTPlot, sliceWasSelectedAtRecordIndex recordIndex: UInt)
100100
{
101101
self.pieGraph?.title = "Selected index: \(recordIndex)"
102102
}

examples/CPTTestApp-iPhone/Classes/ScatterPlotController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class ScatterPlotController : UIViewController, CPTScatterPlotDataSource, CPTAxi
151151

152152
// MARK: - Axis Delegate Methods
153153

154-
private func axis(axis: CPTAxis, shouldUpdateAxisLabelsAtLocations locations: NSSet!) -> Bool
154+
private func axis(_ axis: CPTAxis, shouldUpdateAxisLabelsAtLocations locations: NSSet!) -> Bool
155155
{
156156
if let formatter = axis.labelFormatter {
157157
let labelOffset = axis.labelOffset

examples/DatePlot/DatePlot.xcodeproj/project.pbxproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@
262262
BuildIndependentTargetsInParallel = NO;
263263
LastSwiftUpdateCheck = 0700;
264264
LastUpgradeCheck = 0800;
265+
TargetAttributes = {
266+
8D1107260486CEB800E47090 = {
267+
LastSwiftMigration = 0800;
268+
};
269+
};
265270
};
266271
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "DatePlot" */;
267272
compatibilityVersion = "Xcode 6.3";
@@ -416,6 +421,7 @@
416421
PRODUCT_NAME = DatePlot;
417422
SWIFT_OBJC_BRIDGING_HEADER = "DatePlot-Bridging-Header.h";
418423
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
424+
SWIFT_VERSION = 3.0;
419425
};
420426
name = Debug;
421427
};
@@ -440,6 +446,7 @@
440446
PRODUCT_NAME = DatePlot;
441447
SWIFT_OBJC_BRIDGING_HEADER = "DatePlot-Bridging-Header.h";
442448
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
449+
SWIFT_VERSION = 3.0;
443450
};
444451
name = Release;
445452
};

0 commit comments

Comments
 (0)