Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Swift 5 #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ABVideoRangeSlider/Classes/ABBorder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ABBorder: UIView {

imageView.frame = self.bounds
imageView.image = image
imageView.contentMode = UIViewContentMode.scaleToFill
imageView.contentMode = .scaleToFill
self.addSubview(imageView)
}

Expand Down
2 changes: 1 addition & 1 deletion ABVideoRangeSlider/Classes/ABEndIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ABEndIndicator: UIView {

imageView.frame = self.bounds
imageView.image = image
imageView.contentMode = UIViewContentMode.scaleToFill
imageView.contentMode = .scaleToFill
self.addSubview(imageView)
}

Expand Down
2 changes: 1 addition & 1 deletion ABVideoRangeSlider/Classes/ABProgressIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion ABVideoRangeSlider/Classes/ABStartIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ABStartIndicator: UIView {

imageView.frame = self.bounds
imageView.image = image
imageView.contentMode = UIViewContentMode.scaleToFill
imageView.contentMode = .scaleToFill
self.addSubview(imageView)
}

Expand Down
6 changes: 3 additions & 3 deletions ABVideoRangeSlider/Classes/ABThumbnailsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}
}
Expand Down Expand Up @@ -75,7 +75,7 @@ class ABThumbnailsManager: NSObject {

for i in 0..<imagesCount{
let thumbnail = ABVideoHelper.thumbnailFromVideo(videoUrl: videoURL,
time: CMTimeMake(Int64(offset), 1))
time: CMTimeMake(value: Int64(offset), timescale: 1))
offset = Float64(i) * (duration / Float64(imagesCount))
thumbnails.append(thumbnail)
}
Expand Down
2 changes: 1 addition & 1 deletion ABVideoRangeSlider/Classes/ABTimeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open class ABTimeView: UIView {
height: backgroundView.frame.height)

self.addSubview(backgroundView)
self.sendSubview(toBack: backgroundView)
self.sendSubviewToBack(backgroundView)
}
}

Expand Down
2 changes: 1 addition & 1 deletion ABVideoRangeSlider/Classes/ABVideoRangeSlider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public class ABVideoRangeSlider: UIView, UIGestureRecognizerDelegate {
draggableView.addGestureRecognizer(viewDrag)
self.draggableView.backgroundColor = .clear
self.addSubview(draggableView)
self.sendSubview(toBack: draggableView)
self.sendSubviewToBack(draggableView)

// Setup time labels

Expand Down
84 changes: 23 additions & 61 deletions Example/ABVideoRangeSlider.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
83433F5EAE73B62723E5B059 /* [CP] Embed Pods Frameworks */,
C9C85FF519895AE1A57CD5D6 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -179,8 +178,6 @@
607FACE11AFB9204008FA782 /* Sources */,
607FACE21AFB9204008FA782 /* Frameworks */,
607FACE31AFB9204008FA782 /* Resources */,
8325C882F17F747CC9E6C69A /* [CP] Embed Pods Frameworks */,
79B3BFA6A805CD26794E86C9 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -204,12 +201,12 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = UH5C7ZL9LD;
DevelopmentTeam = 4L8YH7T7L2;
LastSwiftMigration = 0810;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = UH5C7ZL9LD;
DevelopmentTeam = 4L8YH7T7L2;
LastSwiftMigration = 0810;
TestTargetID = 607FACCF1AFB9204008FA782;
};
Expand All @@ -220,6 +217,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -262,13 +260,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_Tests-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";
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 */ = {
Expand All @@ -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 */ = {
Expand All @@ -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 */
Expand Down Expand Up @@ -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;
};
Expand All @@ -498,21 +460,21 @@
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;
};
607FACF31AFB9204008FA782 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D42806DB468F56C07D2DB846 /* Pods-ABVideoRangeSlider_Tests.debug.xcconfig */;
buildSettings = {
DEVELOPMENT_TEAM = UH5C7ZL9LD;
DEVELOPMENT_TEAM = 4L8YH7T7L2;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
Expand All @@ -525,15 +487,15 @@
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;
};
607FACF41AFB9204008FA782 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B211C6C894191DBDEC99740D /* Pods-ABVideoRangeSlider_Tests.release.xcconfig */;
buildSettings = {
DEVELOPMENT_TEAM = UH5C7ZL9LD;
DEVELOPMENT_TEAM = 4L8YH7T7L2;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
Expand All @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion Example/ABVideoRangeSlider/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down