From b3ce542027ba4cfb37884463bdba96429340f7bb Mon Sep 17 00:00:00 2001 From: pfluger Date: Fri, 22 May 2020 18:41:43 -0400 Subject: [PATCH] Update to Swift 5 --- ABVideoRangeSlider/Classes/ABBorder.swift | 2 +- .../Classes/ABEndIndicator.swift | 2 +- .../Classes/ABProgressIndicator.swift | 2 +- .../Classes/ABStartIndicator.swift | 2 +- .../Classes/ABThumbnailsManager.swift | 6 +- ABVideoRangeSlider/Classes/ABTimeView.swift | 2 +- .../Classes/ABVideoRangeSlider.swift | 2 +- .../project.pbxproj | 84 +++++-------------- Example/ABVideoRangeSlider/AppDelegate.swift | 2 +- 9 files changed, 33 insertions(+), 71 deletions(-) diff --git a/ABVideoRangeSlider/Classes/ABBorder.swift b/ABVideoRangeSlider/Classes/ABBorder.swift index fae2746..c5299d6 100644 --- a/ABVideoRangeSlider/Classes/ABBorder.swift +++ b/ABVideoRangeSlider/Classes/ABBorder.swift @@ -20,7 +20,7 @@ class ABBorder: UIView { imageView.frame = self.bounds imageView.image = image - imageView.contentMode = UIViewContentMode.scaleToFill + imageView.contentMode = .scaleToFill self.addSubview(imageView) } diff --git a/ABVideoRangeSlider/Classes/ABEndIndicator.swift b/ABVideoRangeSlider/Classes/ABEndIndicator.swift index 2286644..b97e50b 100644 --- a/ABVideoRangeSlider/Classes/ABEndIndicator.swift +++ b/ABVideoRangeSlider/Classes/ABEndIndicator.swift @@ -21,7 +21,7 @@ class ABEndIndicator: UIView { imageView.frame = self.bounds imageView.image = image - imageView.contentMode = UIViewContentMode.scaleToFill + imageView.contentMode = .scaleToFill self.addSubview(imageView) } diff --git a/ABVideoRangeSlider/Classes/ABProgressIndicator.swift b/ABVideoRangeSlider/Classes/ABProgressIndicator.swift index 5eef82a..a1ff468 100644 --- a/ABVideoRangeSlider/Classes/ABProgressIndicator.swift +++ b/ABVideoRangeSlider/Classes/ABProgressIndicator.swift @@ -19,7 +19,7 @@ class ABProgressIndicator: UIView { let image = UIImage(named: "ProgressIndicator", in: bundle, compatibleWith: nil) imageView.frame = self.bounds imageView.image = image - imageView.contentMode = UIViewContentMode.scaleToFill + imageView.contentMode = .scaleToFill self.addSubview(imageView) } diff --git a/ABVideoRangeSlider/Classes/ABStartIndicator.swift b/ABVideoRangeSlider/Classes/ABStartIndicator.swift index b85c29b..3db1270 100644 --- a/ABVideoRangeSlider/Classes/ABStartIndicator.swift +++ b/ABVideoRangeSlider/Classes/ABStartIndicator.swift @@ -21,7 +21,7 @@ class ABStartIndicator: UIView { imageView.frame = self.bounds imageView.image = image - imageView.contentMode = UIViewContentMode.scaleToFill + imageView.contentMode = .scaleToFill self.addSubview(imageView) } diff --git a/ABVideoRangeSlider/Classes/ABThumbnailsManager.swift b/ABVideoRangeSlider/Classes/ABThumbnailsManager.swift index b2cdda9..fc3075a 100644 --- a/ABVideoRangeSlider/Classes/ABThumbnailsManager.swift +++ b/ABVideoRangeSlider/Classes/ABThumbnailsManager.swift @@ -28,7 +28,7 @@ class ABThumbnailsManager: NSObject { let imageView = UIImageView(image: image) imageView.alpha = 0 - imageView.contentMode = UIViewContentMode.scaleAspectFill + imageView.contentMode = .scaleAspectFill imageView.clipsToBounds = true imageView.frame = CGRect(x: xPos, y: 0.0, @@ -41,7 +41,7 @@ class ABThumbnailsManager: NSObject { UIView.animate(withDuration: 0.2, animations: {() -> Void in imageView.alpha = 1.0 }) - view.sendSubview(toBack: imageView) + view.sendSubviewToBack(imageView) xPos = xPos + view.frame.size.height } } @@ -75,7 +75,7 @@ class ABThumbnailsManager: NSObject { for i in 0.. /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"; + 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; }; 78480F720DCA886153BBBCED /* [CP] Check Pods Manifest.lock */ = { @@ -277,43 +278,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-ABVideoRangeSlider_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../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"; - showEnvVarsInLog = 0; - }; - 79B3BFA6A805CD26794E86C9 /* [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-ABVideoRangeSlider_Tests/Pods-ABVideoRangeSlider_Tests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 8325C882F17F747CC9E6C69A /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ABVideoRangeSlider_Tests/Pods-ABVideoRangeSlider_Tests-frameworks.sh\"\n"; + 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; }; 83433F5EAE73B62723E5B059 /* [CP] Embed Pods Frameworks */ = { @@ -322,28 +296,16 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ABVideoRangeSlider_Example/Pods-ABVideoRangeSlider_Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/ABVideoRangeSlider/ABVideoRangeSlider.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ABVideoRangeSlider.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ABVideoRangeSlider_Example/Pods-ABVideoRangeSlider_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - C9C85FF519895AE1A57CD5D6 /* [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-ABVideoRangeSlider_Example/Pods-ABVideoRangeSlider_Example-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ABVideoRangeSlider_Example/Pods-ABVideoRangeSlider_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -483,13 +445,13 @@ baseConfigurationReference = 6AA7B8FC97BA2D0E80D18B94 /* Pods-ABVideoRangeSlider_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = UH5C7ZL9LD; + DEVELOPMENT_TEAM = 4L8YH7T7L2; INFOPLIST_FILE = ABVideoRangeSlider/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -498,13 +460,13 @@ baseConfigurationReference = 3AC92B9C0F50BBD4AB0B6B59 /* Pods-ABVideoRangeSlider_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = UH5C7ZL9LD; + DEVELOPMENT_TEAM = 4L8YH7T7L2; INFOPLIST_FILE = ABVideoRangeSlider/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -512,7 +474,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D42806DB468F56C07D2DB846 /* Pods-ABVideoRangeSlider_Tests.debug.xcconfig */; buildSettings = { - DEVELOPMENT_TEAM = UH5C7ZL9LD; + DEVELOPMENT_TEAM = 4L8YH7T7L2; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -525,7 +487,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -533,7 +495,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = B211C6C894191DBDEC99740D /* Pods-ABVideoRangeSlider_Tests.release.xcconfig */; buildSettings = { - DEVELOPMENT_TEAM = UH5C7ZL9LD; + DEVELOPMENT_TEAM = 4L8YH7T7L2; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -542,7 +504,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Example/ABVideoRangeSlider/AppDelegate.swift b/Example/ABVideoRangeSlider/AppDelegate.swift index 719e288..ad1bd23 100644 --- a/Example/ABVideoRangeSlider/AppDelegate.swift +++ b/Example/ABVideoRangeSlider/AppDelegate.swift @@ -14,7 +14,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 { // Override point for customization after application launch. return true }