Permalink
Browse files

Swift 4.2 Migration (#33)

* Migrate to swift 4.2

* Modify config files and README.md to indicate version upgrade

* Update travis ci build image

* Update Podfile for the example project

* Cleanup compiler warnings
  • Loading branch information...
alex-taffe authored and iwasrobbed committed Oct 10, 2018
1 parent e38aa0e commit e6b0ceb86705f0391f9e962d52a19d91db6a6338
View
@@ -1 +1 @@
4.0
4.2
View
@@ -1,16 +1,16 @@
osx_image: xcode9
osx_image: xcode10
rvm:
- 2.2.2
language: objective-c
before_install:
before_install:
- gem install cocoapods
- pod repo update
- gem install xcpretty slather -N
- xcrun instruments -w "iPhone 6 (11.0)" || echo "(Pre)Launched the simulator."
cache: cocoapods
podfile: Example/Podfile
script:
- set -o pipefail && xcodebuild test -workspace example/RPCircularProgressExample.xcworkspace -scheme "RPCircularProgressExample" -destination "platform=iOS Simulator,name=iPhone 6,OS=11.0" -enableCodeCoverage YES ONLY_ACTIVE_ARCH=YES | xcpretty -c
- set -o pipefail && xcodebuild test -workspace example/RPCircularProgressExample.xcworkspace -scheme "RPCircularProgressExample" -destination "platform=iOS Simulator,name=iPhone XS,OS=12.0" -enableCodeCoverage YES ONLY_ACTIVE_ARCH=YES | xcpretty -c
after_success:
- pod lib lint --allow-warnings
- slather coverage --ignore "../**/*/Xcode*" --scheme "RPCircularProgressExample" --workspace example/RPCircularProgressExample.xcworkspace example/RPCircularProgressExample.xcodeproj
View
@@ -10,14 +10,14 @@ project 'RPCircularProgressExample'
target 'RPCircularProgressExample' do
# Autolayout
pod 'SnapKit', '~> 4.0.0'
pod 'SnapKit', '~> 4.0.0'
target 'RPCircularProgressTests' do
inherit! :search_paths
# Tests
pod 'Quick', '~> 1.2.0'
pod 'Nimble', '~> 7.0.1'
pod 'Quick', '~> 1.3.2'
pod 'Nimble', '~> 7.3.1'
end
end
View
@@ -1,18 +1,24 @@
PODS:
- Nimble (7.0.2)
- Quick (1.2.0)
- SnapKit (4.0.0)
- Nimble (7.3.1)
- Quick (1.3.2)
- SnapKit (4.0.1)
DEPENDENCIES:
- Nimble (~> 7.0.1)
- Quick (~> 1.2.0)
- Nimble (~> 7.3.1)
- Quick (~> 1.3.2)
- SnapKit (~> 4.0.0)
SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- Nimble
- Quick
- SnapKit
SPEC CHECKSUMS:
Nimble: bfe1f814edabba69ff145cb1283e04ed636a67f2
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
SnapKit: a42d492c16e80209130a3379f73596c3454b7694
Nimble: 04f732da099ea4d153122aec8c2a88fd0c7219ae
Quick: 2623cb30d7a7f41ca62f684f679586558f483d46
SnapKit: 0de968a9fec17499afa29683b05d0c775b6d1c29
PODFILE CHECKSUM: d0f5db20054c0451b7de251f86a1745615a71633
PODFILE CHECKSUM: 14489d38b0980855eca2cc9f747e94c1b31ef727
COCOAPODS: 1.3.1
COCOAPODS: 1.5.0
@@ -155,7 +155,6 @@
D427C24F1CB47562004980FF /* Frameworks */,
D427C2501CB47562004980FF /* Resources */,
12F42A439368346AA74ABE15 /* [CP] Embed Pods Frameworks */,
6C842F4DFBE5F0286410D804 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -175,7 +174,6 @@
D4756A461CB5D82E00432482 /* Frameworks */,
D4756A471CB5D82E00432482 /* Resources */,
36A6C7A149C59F7BC1A7E542 /* [CP] Embed Pods Frameworks */,
EB1E68EAC2305375EE8BCC05 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -194,16 +192,17 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Glazed Donut, LLC.";
TargetAttributes = {
D427C2511CB47562004980FF = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0800;
DevelopmentTeam = S4JEZRL8YY;
LastSwiftMigration = 1000;
};
D4756A481CB5D82E00432482 = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0800;
LastSwiftMigration = 1000;
TestTargetID = D427C2511CB47562004980FF;
};
};
@@ -303,36 +302,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
6C842F4DFBE5F0286410D804 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RPCircularProgressExample/Pods-RPCircularProgressExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
EB1E68EAC2305375EE8BCC05 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RPCircularProgressTests/Pods-RPCircularProgressTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F438BB9F13553B574C595861 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -397,12 +366,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -452,12 +423,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -494,12 +467,13 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = S4JEZRL8YY;
INFOPLIST_FILE = RPCircularProgressExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazedDonut.RPCircularProgressExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
@@ -510,11 +484,12 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = S4JEZRL8YY;
INFOPLIST_FILE = RPCircularProgressExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazedDonut.RPCircularProgressExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
@@ -528,7 +503,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazedDonut.RPCircularProgressTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RPCircularProgressExample.app/RPCircularProgressExample";
};
name = Debug;
@@ -543,7 +518,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.glazedDonut.RPCircularProgressTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RPCircularProgressExample.app/RPCircularProgressExample";
};
name = Release;
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,9 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
@@ -57,7 +56,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -15,7 +15,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
setupRootView()
View
@@ -12,7 +12,9 @@
⚠️ To use with Swift 4.x please ensure you are using >= 0.4.0 ⚠️
UIView subclass written in Swift to show circular progress.
⚠️ To use with Swift 4.2 please ensure you are using >= 0.4.1 ⚠️
UIView subclass written in Swift to show circular progress.
![Example Usage](ohhai.gif)
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|
spec.name = "RPCircularProgress"
spec.summary = "Swift UIView subclass with circular progress properties."
spec.version = "0.4.0"
spec.version = "0.4.1"
spec.homepage = "https://github.com/iwasrobbed/RPCircularProgress"
spec.license = { :type => "MIT", :file => "LICENSE" }
spec.authors = { "Rob Phillips" => "rob@robphillips.me" }
@@ -99,7 +99,7 @@ open class RPCircularProgress: UIView {
/**
A timing function defining the pacing of the animation. Defaults to ease in, ease out.
*/
open var timingFunction: CAMediaTimingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
open var timingFunction: CAMediaTimingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
/**
Getter for the current progress (not observed from any active animations)
@@ -133,7 +133,7 @@ open class RPCircularProgress: UIView {
fileprivate var progressLayer: ProgressLayer! {
get {
return layer as! ProgressLayer
return (layer as! ProgressLayer)
}
}
@@ -270,7 +270,7 @@ private extension RPCircularProgress {
animation.duration = duration
animation.timingFunction = timingFunction
animation.fromValue = currentProgress
animation.fillMode = kCAFillModeForwards
animation.fillMode = CAMediaTimingFillMode.forwards
animation.isRemovedOnCompletion = false
animation.toValue = pinnedProgress
animation.beginTime = CACurrentMediaTime() + initialDelay
@@ -83,7 +83,7 @@ class RPCircularProgressTests: QuickSpec {
}
it("should have the correct timing function") {
let timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
let timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
progress.timingFunction = timingFunction
progress.updateProgress(1, duration: 2)

0 comments on commit e6b0ceb

Please sign in to comment.