Skip to content

Commit cd3c0a0

Browse files
authored
Merge pull request #24 from fumiyasac/master
Convert to Swift4.2 syntax & Xcode10 project.
2 parents 40090e6 + 40fbebe commit cd3c0a0

File tree

9 files changed

+47
-26
lines changed

9 files changed

+47
-26
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0
1+
4.2

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
language: objective-c
66
podfile: Example/Podfile
7-
osx_image: xcode9
7+
osx_image: xcode10
88
#xcode_workspace: Example/FlexibleSteppedProgressBar.xcworkspace
99
#xcode_scheme: FlexibleSteppedProgressBar-Example
10-
xcode_sdk: iphonesimulator11.0
10+
xcode_sdk: iphonesimulator12.0
1111

1212
before_install:
1313
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
1414

1515
script:
16-
- set -o pipefail && xcodebuild build -workspace Example/FlexibleSteppedProgressBar.xcworkspace -scheme FlexibleSteppedProgressBar-Example -sdk iphonesimulator11.0 ONLY_ACTIVE_ARCH=NO | xcpretty
16+
- set -o pipefail && xcodebuild build -workspace Example/FlexibleSteppedProgressBar.xcworkspace -scheme FlexibleSteppedProgressBar-Example -sdk iphonesimulator12.0 ONLY_ACTIVE_ARCH=NO | xcpretty

Example/FlexibleSteppedProgressBar.xcodeproj/project.pbxproj

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@
210210
isa = PBXProject;
211211
attributes = {
212212
LastSwiftUpdateCheck = 0720;
213-
LastUpgradeCheck = 0900;
213+
LastUpgradeCheck = 1010;
214214
ORGANIZATIONNAME = CocoaPods;
215215
TargetAttributes = {
216216
607FACCF1AFB9204008FA782 = {
217217
CreatedOnToolsVersion = 6.3.1;
218-
LastSwiftMigration = 0800;
218+
LastSwiftMigration = 1010;
219219
ProvisioningStyle = Automatic;
220220
};
221221
607FACE41AFB9204008FA782 = {
222222
CreatedOnToolsVersion = 6.3.1;
223-
LastSwiftMigration = 0800;
223+
LastSwiftMigration = 1010;
224224
};
225225
};
226226
};
@@ -425,12 +425,14 @@
425425
CLANG_WARN_BOOL_CONVERSION = YES;
426426
CLANG_WARN_COMMA = YES;
427427
CLANG_WARN_CONSTANT_CONVERSION = YES;
428+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
428429
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
429430
CLANG_WARN_EMPTY_BODY = YES;
430431
CLANG_WARN_ENUM_CONVERSION = YES;
431432
CLANG_WARN_INFINITE_RECURSION = YES;
432433
CLANG_WARN_INT_CONVERSION = YES;
433434
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
435+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
434436
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
435437
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
436438
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -463,7 +465,7 @@
463465
ONLY_ACTIVE_ARCH = YES;
464466
SDKROOT = iphoneos;
465467
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
466-
SWIFT_VERSION = 4.0;
468+
SWIFT_VERSION = 4.2;
467469
};
468470
name = Debug;
469471
};
@@ -479,12 +481,14 @@
479481
CLANG_WARN_BOOL_CONVERSION = YES;
480482
CLANG_WARN_COMMA = YES;
481483
CLANG_WARN_CONSTANT_CONVERSION = YES;
484+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
482485
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
483486
CLANG_WARN_EMPTY_BODY = YES;
484487
CLANG_WARN_ENUM_CONVERSION = YES;
485488
CLANG_WARN_INFINITE_RECURSION = YES;
486489
CLANG_WARN_INT_CONVERSION = YES;
487490
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
491+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
488492
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
489493
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
490494
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -509,7 +513,7 @@
509513
MTL_ENABLE_DEBUG_INFO = NO;
510514
SDKROOT = iphoneos;
511515
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
512-
SWIFT_VERSION = 4.0;
516+
SWIFT_VERSION = 4.2;
513517
VALIDATE_PRODUCT = YES;
514518
};
515519
name = Release;
@@ -530,7 +534,7 @@
530534
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
531535
PRODUCT_NAME = "$(TARGET_NAME)";
532536
PROVISIONING_PROFILE_SPECIFIER = "";
533-
SWIFT_VERSION = 4.0;
537+
SWIFT_VERSION = 4.2;
534538
};
535539
name = Debug;
536540
};
@@ -550,14 +554,15 @@
550554
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
551555
PRODUCT_NAME = "$(TARGET_NAME)";
552556
PROVISIONING_PROFILE_SPECIFIER = "";
553-
SWIFT_VERSION = 4.0;
557+
SWIFT_VERSION = 4.2;
554558
};
555559
name = Release;
556560
};
557561
607FACF31AFB9204008FA782 /* Debug */ = {
558562
isa = XCBuildConfiguration;
559563
baseConfigurationReference = 81BC34F00796F5397406C917 /* Pods-FlexibleSteppedProgressBar_Tests.debug.xcconfig */;
560564
buildSettings = {
565+
DEVELOPMENT_TEAM = "";
561566
FRAMEWORK_SEARCH_PATHS = (
562567
"$(SDKROOT)/Developer/Library/Frameworks",
563568
"$(inherited)",
@@ -570,14 +575,15 @@
570575
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
571576
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
572577
PRODUCT_NAME = "$(TARGET_NAME)";
573-
SWIFT_VERSION = 4.0;
578+
SWIFT_VERSION = 4.2;
574579
};
575580
name = Debug;
576581
};
577582
607FACF41AFB9204008FA782 /* Release */ = {
578583
isa = XCBuildConfiguration;
579584
baseConfigurationReference = 6232E94BA646FA401AD96F44 /* Pods-FlexibleSteppedProgressBar_Tests.release.xcconfig */;
580585
buildSettings = {
586+
DEVELOPMENT_TEAM = "";
581587
FRAMEWORK_SEARCH_PATHS = (
582588
"$(SDKROOT)/Developer/Library/Frameworks",
583589
"$(inherited)",
@@ -586,7 +592,7 @@
586592
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
587593
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
588594
PRODUCT_NAME = "$(TARGET_NAME)";
589-
SWIFT_VERSION = 4.0;
595+
SWIFT_VERSION = 4.2;
590596
};
591597
name = Release;
592598
};

Example/FlexibleSteppedProgressBar.xcodeproj/xcshareddata/xcschemes/FlexibleSteppedProgressBar-Example.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1010"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
language = ""
4443
shouldUseLaunchSchemeArgsEnv = "YES">
4544
<Testables>
4645
<TestableReference
@@ -70,7 +69,6 @@
7069
buildConfiguration = "Debug"
7170
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7271
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73-
language = ""
7472
launchStyle = "0"
7573
useCustomWorkingDirectory = "NO"
7674
ignoresPersistentStateOnLaunch = "NO"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Example/FlexibleSteppedProgressBar/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
1919
return true
2020
}

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FlexibleSteppedProgressBar/Classes/FSPBTextLayerExtension.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ extension CATextLayer {
1616

1717
let font = UIFont(name: fontName, size: self.fontSize)
1818

19-
let attributes = NSDictionary(object: font!, forKey: NSAttributedStringKey.font as NSCopying)
19+
let attributes = NSDictionary(object: font!, forKey: NSAttributedString.Key.font as NSCopying)
2020

21-
let attString = NSAttributedString(string: self.string as! String, attributes: attributes as? [NSAttributedStringKey : AnyObject])
21+
let attString = NSAttributedString(string: self.string as! String, attributes: attributes as? [NSAttributedString.Key : AnyObject])
2222

2323
var ascent: CGFloat = 0, descent: CGFloat = 0, width: CGFloat = 0
2424

FlexibleSteppedProgressBar/Classes/FlexibleSteppedProgressBar.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ import CoreGraphics
304304
self.layer.addSublayer(self.roadToSelectionLayer)
305305
self.progressLayer.mask = self.maskLayer
306306

307-
self.contentMode = UIViewContentMode.redraw
307+
self.contentMode = UIView.ContentMode.redraw
308308
}
309309

310310
override open func draw(_ rect: CGRect) {
@@ -409,7 +409,7 @@ import CoreGraphics
409409
progressAnimation.duration = stepAnimationDuration * CFTimeInterval(abs(completedTillIndex - previousIndex))
410410
progressAnimation.toValue = maskPath
411411
progressAnimation.isRemovedOnCompletion = false
412-
progressAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
412+
progressAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
413413

414414

415415
CATransaction.setCompletionBlock { () -> Void in
@@ -733,8 +733,8 @@ import CoreGraphics
733733
- parameter gestureRecognizer: The gesture recognizer responsible for the action
734734
*/
735735
@objc func gestureAction(_ gestureRecognizer: UIGestureRecognizer) {
736-
if(gestureRecognizer.state == UIGestureRecognizerState.ended ||
737-
gestureRecognizer.state == UIGestureRecognizerState.changed ) {
736+
if(gestureRecognizer.state == UIGestureRecognizer.State.ended ||
737+
gestureRecognizer.state == UIGestureRecognizer.State.changed ) {
738738

739739
let touchPoint = gestureRecognizer.location(in: self)
740740

0 commit comments

Comments
 (0)