Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit ee3e4ea

Browse files
dareckiluispadron
authored andcommitted
Migration to Swift 5 (#179)
1 parent 5f8a84e commit ee3e4ea

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: swift
2-
osx_image: xcode10
2+
osx_image: xcode10.2
33

44
xcode_project: src/UICircularProgressRing.xcodeproj
55
xcode_scheme: UICircularProgressRing

src/UICircularProgressRing.xcodeproj/project.pbxproj

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,29 +177,30 @@
177177
isa = PBXProject;
178178
attributes = {
179179
LastSwiftUpdateCheck = 0800;
180-
LastUpgradeCheck = 0930;
180+
LastUpgradeCheck = 1020;
181181
ORGANIZATIONNAME = "Luis Padron";
182182
TargetAttributes = {
183183
A0C6DE7B1D88CBE1008AE742 = {
184184
CreatedOnToolsVersion = 8.0;
185185
DevelopmentTeam = 4FNMZ7SN42;
186-
LastSwiftMigration = "";
186+
LastSwiftMigration = 1020;
187187
ProvisioningStyle = Automatic;
188188
};
189189
A0C6DE841D88CBE2008AE742 = {
190190
CreatedOnToolsVersion = 8.0;
191191
DevelopmentTeam = 4FNMZ7SN42;
192-
LastSwiftMigration = "";
192+
LastSwiftMigration = 1020;
193193
ProvisioningStyle = Automatic;
194194
};
195195
};
196196
};
197197
buildConfigurationList = A0C6DE761D88CBE1008AE742 /* Build configuration list for PBXProject "UICircularProgressRing" */;
198198
compatibilityVersion = "Xcode 3.2";
199-
developmentRegion = English;
199+
developmentRegion = en;
200200
hasScannedForEncodings = 0;
201201
knownRegions = (
202202
en,
203+
Base,
203204
);
204205
mainGroup = A0C6DE721D88CBE1008AE742;
205206
productRefGroup = A0C6DE7D1D88CBE1008AE742 /* Products */;
@@ -287,6 +288,7 @@
287288
isa = XCBuildConfiguration;
288289
buildSettings = {
289290
ALWAYS_SEARCH_USER_PATHS = NO;
291+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
290292
CLANG_ANALYZER_NONNULL = YES;
291293
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
292294
CLANG_CXX_LIBRARY = "libc++";
@@ -351,6 +353,7 @@
351353
isa = XCBuildConfiguration;
352354
buildSettings = {
353355
ALWAYS_SEARCH_USER_PATHS = NO;
356+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
354357
CLANG_ANALYZER_NONNULL = YES;
355358
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
356359
CLANG_CXX_LIBRARY = "libc++";
@@ -423,8 +426,7 @@
423426
PRODUCT_NAME = "$(TARGET_NAME)";
424427
SKIP_INSTALL = YES;
425428
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
426-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
427-
SWIFT_VERSION = 4.2;
429+
SWIFT_VERSION = 5.0;
428430
};
429431
name = Debug;
430432
};
@@ -446,8 +448,7 @@
446448
PRODUCT_BUNDLE_IDENTIFIER = com.luispadron.UICircularProgressRing;
447449
PRODUCT_NAME = "$(TARGET_NAME)";
448450
SKIP_INSTALL = YES;
449-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
450-
SWIFT_VERSION = 4.2;
451+
SWIFT_VERSION = 5.0;
451452
};
452453
name = Release;
453454
};
@@ -460,8 +461,7 @@
460461
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
461462
PRODUCT_BUNDLE_IDENTIFIER = com.luispadron.UICircularProgressRingTests;
462463
PRODUCT_NAME = "$(TARGET_NAME)";
463-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
464-
SWIFT_VERSION = 4.2;
464+
SWIFT_VERSION = 5.0;
465465
};
466466
name = Debug;
467467
};
@@ -474,8 +474,7 @@
474474
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
475475
PRODUCT_BUNDLE_IDENTIFIER = com.luispadron.UICircularProgressRingTests;
476476
PRODUCT_NAME = "$(TARGET_NAME)";
477-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
478-
SWIFT_VERSION = 4.2;
477+
SWIFT_VERSION = 5.0;
479478
};
480479
name = Release;
481480
};

src/UICircularProgressRing.xcodeproj/xcshareddata/xcschemes/UICircularProgressRing.xcscheme

Lines changed: 1 addition & 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 = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

src/UICircularProgressRing/UICircularRingLayer.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class UICircularRingLayer: CAShapeLayer {
7373

7474
// Returns whether or not a given property key is animatable
7575
static func isAnimatableProperty(_ key: String) -> Bool {
76-
return animatableProperties.index(of: key) != nil
76+
return animatableProperties.firstIndex(of: key) != nil
7777
}
7878

7979
// MARK: Init
@@ -265,9 +265,10 @@ class UICircularRingLayer: CAShapeLayer {
265265

266266
case .bordered(let borderWidth, let borderColor):
267267
let center: CGPoint = CGPoint(x: bounds.midX, y: bounds.midY)
268+
let knobSize = valueKnobStyle?.size ?? 0
268269
let offSet = max(ring.outerRingWidth, ring.innerRingWidth) / 2
269-
+ ((valueKnobStyle?.size ?? 0) / 4)
270-
+ (borderWidth * 2)
270+
+ knobSize / 4
271+
+ borderWidth * 2
271272
let outerRadius: CGFloat = min(bounds.width, bounds.height) / 2 - offSet
272273
let borderStartAngle = ring.outerCapStyle == .butt ? ring.startAngle - borderWidth : ring.startAngle
273274
let borderEndAngle = ring.outerCapStyle == .butt ? ring.endAngle + borderWidth : ring.endAngle

0 commit comments

Comments
 (0)