Commit 03a8f562 by Daniel Dahan

prepared for Swift 5

parent f6ebb024
Pod::Spec.new do |s|
s.name = 'Motion'
s.version = '3.0.0'
s.swift_version = '4.2'
s.version = '3.1.0'
s.swift_version = '5.0'
s.license = 'MIT'
s.summary = 'A library used to create beautiful animations and transitions for Apple devices.'
s.homepage = 'http://cosmicmind.com'
......
......@@ -329,7 +329,7 @@
TargetAttributes = {
96C98DD01E424AB000B22906 = {
CreatedOnToolsVersion = 8.2.1;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
......@@ -546,7 +546,7 @@
SKIP_INSTALL = YES;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
......@@ -567,7 +567,7 @@
PRODUCT_NAME = Motion;
SKIP_INSTALL = YES;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0.0</string>
<string>3.1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
......
......@@ -223,7 +223,7 @@ public extension MotionContext {
superviewToNoSnapshotSubviewMap[view.superview!] = []
}
superviewToNoSnapshotSubviewMap[view.superview!]!.append((view.superview!.subviews.index(of: view)!, view))
superviewToNoSnapshotSubviewMap[view.superview!]!.append((view.superview!.subviews.firstIndex(of: view)!, view))
}
snapshot = view
......@@ -322,7 +322,7 @@ public extension MotionContext {
if let pairedView = pairedView(for: view), let pairedSnapshot = viewToSnapshot[pairedView] {
let siblingViews = pairedView.superview!.subviews
let nextSiblings = siblingViews[siblingViews.index(of: pairedView)! + 1..<siblingViews.count]
let nextSiblings = siblingViews[siblingViews.firstIndex(of: pairedView)! + 1..<siblingViews.count]
containerView.addSubview(pairedSnapshot)
containerView.addSubview(snapshot)
......
......@@ -50,8 +50,8 @@ extension MotionTransition: UITabBarControllerDelegate {
state = .notified
let fromVCIndex = tabBarController.children.index(of: fromVC)!
let toVCIndex = tabBarController.children.index(of: toVC)!
let fromVCIndex = tabBarController.children.firstIndex(of: fromVC)!
let toVCIndex = tabBarController.children.firstIndex(of: toVC)!
isPresenting = toVCIndex > fromVCIndex
fromViewController = fromViewController ?? fromVC
......
......@@ -526,7 +526,7 @@ internal extension MotionTransition {
- Returns: A boolean indicating if the plugin is enabled or not.
*/
static func isEnabled(plugin: MotionPlugin.Type) -> Bool {
return nil != enabledPlugins.index(where: { return $0 == plugin })
return nil != enabledPlugins.firstIndex(where: { return $0 == plugin })
}
/**
......@@ -543,7 +543,7 @@ internal extension MotionTransition {
- Parameter plugin: A MotionPlugin.Type.
*/
static func disable(plugin: MotionPlugin.Type) {
guard let index = enabledPlugins.index(where: { return $0 == plugin }) else {
guard let index = enabledPlugins.firstIndex(where: { return $0 == plugin }) else {
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment