Skip to content

Commit c66dcc9

Browse files
committed
Upgrade to swift 4.0
1 parent 159a168 commit c66dcc9

File tree

6 files changed

+36
-15
lines changed

6 files changed

+36
-15
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
44
[![Swift Version][swift-image]][swift-url]
55
[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/TBXark/TKRadarChart/master/LICENSE)
6-
[![CocoaPods](http://img.shields.io/cocoapods/v/TKRadarChart.svg?style=flat)](http://cocoapods.org/?q= TKRadarChart)
7-
[![CocoaPods](http://img.shields.io/cocoapods/p/TKRadarChart.svg?style=flat)](http://cocoapods.org/?q= TKRadarChart)
6+
[![CocoaPods](http://img.shields.io/cocoapods/v/TKRadarChart.svg?style=flat)](http://cocoapods.org/?q=TKRadarChart)
7+
[![CocoaPods](http://img.shields.io/cocoapods/p/TKRadarChart.svg?style=flat)](http://cocoapods.org/?q=TKRadarChart)
88
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
99
[![Support](https://img.shields.io/badge/support-iOS%208%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)
1010

@@ -14,8 +14,8 @@
1414
## Requirements
1515

1616
- iOS 8.0+
17-
- Xcode 8.0
18-
- Swift 3.0
17+
- Xcode 9.0
18+
- Swift 4.0
1919

2020
## Installation
2121

@@ -105,8 +105,11 @@ protocol TKRadarChartDelegate: class {
105105

106106
## Release History
107107

108+
* 1.4.0
109+
Upgrade to swift 4.0
110+
108111
* 1.3.1
109-
Upgrade framework config
112+
Upgrade framework config
110113

111114
* 1.3.0
112115
Support swift 3.0

TKRadarChart.xcodeproj/project.pbxproj

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@
174174
isa = PBXProject;
175175
attributes = {
176176
LastSwiftUpdateCheck = 0810;
177-
LastUpgradeCheck = 0800;
177+
LastUpgradeCheck = 0900;
178178
ORGANIZATIONNAME = Tbxark;
179179
TargetAttributes = {
180180
6A3F39B41DEB1E1A0067576C = {
181181
CreatedOnToolsVersion = 8.1;
182182
DevelopmentTeam = 858CBVXSWP;
183-
LastSwiftMigration = 0810;
183+
LastSwiftMigration = 0900;
184184
ProvisioningStyle = Automatic;
185185
};
186186
6A415EEF1DEB1DAC001DBF69 = {
@@ -299,7 +299,8 @@
299299
SKIP_INSTALL = YES;
300300
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
301301
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
302-
SWIFT_VERSION = 3.0;
302+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
303+
SWIFT_VERSION = 4.0;
303304
VERSIONING_SYSTEM = "apple-generic";
304305
VERSION_INFO_PREFIX = "";
305306
};
@@ -325,7 +326,8 @@
325326
PRODUCT_BUNDLE_IDENTIFIER = com.play.TKRadarChart;
326327
PRODUCT_NAME = "$(TARGET_NAME)";
327328
SKIP_INSTALL = YES;
328-
SWIFT_VERSION = 3.0;
329+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
330+
SWIFT_VERSION = 4.0;
329331
VERSIONING_SYSTEM = "apple-generic";
330332
VERSION_INFO_PREFIX = "";
331333
};
@@ -375,14 +377,20 @@
375377
CLANG_CXX_LIBRARY = "libc++";
376378
CLANG_ENABLE_MODULES = YES;
377379
CLANG_ENABLE_OBJC_ARC = YES;
380+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
378381
CLANG_WARN_BOOL_CONVERSION = YES;
382+
CLANG_WARN_COMMA = YES;
379383
CLANG_WARN_CONSTANT_CONVERSION = YES;
380384
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
381385
CLANG_WARN_EMPTY_BODY = YES;
382386
CLANG_WARN_ENUM_CONVERSION = YES;
383387
CLANG_WARN_INFINITE_RECURSION = YES;
384388
CLANG_WARN_INT_CONVERSION = YES;
389+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
390+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
385391
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
392+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
393+
CLANG_WARN_STRICT_PROTOTYPES = YES;
386394
CLANG_WARN_SUSPICIOUS_MOVE = YES;
387395
CLANG_WARN_UNREACHABLE_CODE = YES;
388396
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -423,14 +431,20 @@
423431
CLANG_CXX_LIBRARY = "libc++";
424432
CLANG_ENABLE_MODULES = YES;
425433
CLANG_ENABLE_OBJC_ARC = YES;
434+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
426435
CLANG_WARN_BOOL_CONVERSION = YES;
436+
CLANG_WARN_COMMA = YES;
427437
CLANG_WARN_CONSTANT_CONVERSION = YES;
428438
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
429439
CLANG_WARN_EMPTY_BODY = YES;
430440
CLANG_WARN_ENUM_CONVERSION = YES;
431441
CLANG_WARN_INFINITE_RECURSION = YES;
432442
CLANG_WARN_INT_CONVERSION = YES;
443+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
444+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
433445
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
446+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
447+
CLANG_WARN_STRICT_PROTOTYPES = YES;
434448
CLANG_WARN_SUSPICIOUS_MOVE = YES;
435449
CLANG_WARN_UNREACHABLE_CODE = YES;
436450
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
20.1 KB
Binary file not shown.

TKRadarChart.xcodeproj/xcshareddata/xcschemes/TKRadarChart.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0810"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Debug"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"

TKRadarChart.xcodeproj/xcuserdata/Tbxark.xcuserdatad/xcschemes/TKRadarChartDemo.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0810"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -45,6 +46,7 @@
4546
buildConfiguration = "Debug"
4647
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4748
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49+
language = ""
4850
launchStyle = "0"
4951
useCustomWorkingDirectory = "NO"
5052
ignoresPersistentStateOnLaunch = "NO"

TKRadarChart/TKRadarChart.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public class TKRadarChart: UIView, TKRadarChartDelegate {
203203
let title = dataSource.titleOfRowForRadarChart(self, row: index)
204204
let pointOnEdge = CGPoint(x: centerPoint.x - radius * sin(i * perAngle),
205205
y: centerPoint.y - radius * cos(i * perAngle))
206-
let attributeTextSize = (title as NSString).size(attributes: [NSFontAttributeName: textFont])
206+
let attributeTextSize = (title as NSString).size(withAttributes: [NSAttributedStringKey.font: textFont])
207207

208208
let width = attributeTextSize.width
209209
let xOffset = pointOnEdge.x >= centerPoint .x ? width / 2.0 + padding : -width / 2.0 - padding
@@ -213,9 +213,9 @@ public class TKRadarChart: UIView, TKRadarChartDelegate {
213213
let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
214214
paragraphStyle.alignment = .center
215215
paragraphStyle.lineBreakMode = .byClipping
216-
let attributes = [NSFontAttributeName: textFont,
217-
NSParagraphStyleAttributeName: paragraphStyle,
218-
NSForegroundColorAttributeName: titleColor]
216+
let attributes = [NSAttributedStringKey.font: textFont,
217+
NSAttributedStringKey.paragraphStyle: paragraphStyle,
218+
NSAttributedStringKey.foregroundColor: titleColor]
219219

220220
/// Fix title offset
221221
if index == 0 || (numOfRow%2 == 0 && index == numOfRow/2){

0 commit comments

Comments
 (0)