Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

support swift version 4.2 #13

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
16 changes: 8 additions & 8 deletions CardStackController/Classes/CardStackController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import UIKit

public class CardStackController: UIViewController {

public typealias CompletionBlock = (Void) -> ()
public typealias CompletionBlock = () -> ()

fileprivate struct CardStackControllerPalette {
static let backgroundColor = UIColor.black.withAlphaComponent(0.4)
Expand Down Expand Up @@ -208,7 +208,7 @@ public class CardStackController: UIViewController {
anim.toValue = NSValue(caTransform3D: finalTransform)
anim.duration = 0.4
anim.timingFunction = CAMediaTimingFunction(controlPoints: 0.1, 0.5, 0.5, 1)
anim.fillMode = kCAFillModeForwards
anim.fillMode = CAMediaTimingFillMode.forwards
anim.isRemovedOnCompletion = false
viewController.view.layer.add(anim, forKey: "transform")
}
Expand All @@ -233,10 +233,10 @@ public class CardStackController: UIViewController {

fileprivate func addChild(viewController newController: UIViewController, containerView: UIView, fakeViewBackgroundColor: UIColor?) {
viewControllers.append(newController)
addChildViewController(newController)
addChild(newController)
containerView.addSubview(newController.view)
addFakeBottomView(underneath: newController.view, with: fakeViewBackgroundColor)
newController.didMove(toParentViewController: self)
newController.didMove(toParent: self)
}

fileprivate func attach(view aView: UIView, toAnchorPoint anchorPoint: CGPoint) {
Expand Down Expand Up @@ -366,7 +366,7 @@ public class CardStackController: UIViewController {
anim.toValue = NSValue(caTransform3D: CATransform3DIdentity)
anim.duration = duration
anim.timingFunction = CAMediaTimingFunction(controlPoints: 0.1, 0.5, 0.5, 1)
anim.fillMode = kCAFillModeForwards
anim.fillMode = CAMediaTimingFillMode.forwards
anim.isRemovedOnCompletion = false
viewController.view.layer.add(anim, forKey: "transformBack")
}
Expand Down Expand Up @@ -422,10 +422,10 @@ public class CardStackController: UIViewController {
guard let viewController = topViewController,
let currentBehaviour = attachmentBehaviors.last,
let viewControllerSuperview = viewController.view.superview else { return }
viewController.willMove(toParentViewController: nil)
viewController.willMove(toParent: nil)
viewController.view.removeFromSuperview()
viewControllerSuperview.removeFromSuperview()
viewController.removeFromParentViewController()
viewController.removeFromParent()
viewControllers.removeLast()
animator.removeBehavior(currentBehaviour)
attachmentBehaviors.removeLast()
Expand All @@ -439,7 +439,7 @@ public class CardStackController: UIViewController {
animator.removeBehavior(dynamicItemBehavior)
animator.removeBehavior(collisionBehavior)
guard automaticallyDismiss else { return }
dismiss(animated: false) { finished in
dismiss(animated: false) {
self.delegate?.didFinishDismissingCardController?()
}
}
Expand Down
6 changes: 4 additions & 2 deletions Example/CardStackController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand Down Expand Up @@ -493,6 +494,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -509,7 +511,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "com.jobandtalent.CardStackController-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -525,7 +527,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "com.jobandtalent.CardStackController-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Example/CardStackController/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
20 changes: 9 additions & 11 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.