Permalink
Browse files

Make it compile

  • Loading branch information...
lkzhao committed Aug 23, 2016
1 parent 779c8e4 commit a1a453d5330fa01a1e914a61f8f3579f105e7e36
@@ -58,10 +58,10 @@ public class EdgePanTransition: NSObject, UIViewControllerAnimatedTransitioning,
return fromViewController.view
}
var toViewController:UIViewController{
return transitionContext.viewController(forKey: UITransitionContextToViewControllerKey)!
return transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)!
}
var fromViewController:UIViewController{
return transitionContext.viewController(forKey: UITransitionContextFromViewControllerKey)!
return transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)!
}
var currentPanGR: UIPanGestureRecognizer?
@@ -55,7 +55,7 @@ public class ElasticShapeLayer: CAShapeLayer {
fillColor = UIColor.black.cgColor
actions = ["path" : NSNull(), "position" : NSNull(), "bounds" : NSNull(), "fillColor" : NSNull()]
}
override public init(layer: AnyObject) {
override public init(layer: Any) {
super.init(layer: layer)
}
@@ -144,7 +144,7 @@ public class ElasticTransition: EdgePanTransition, UIGestureRecognizerDelegate{
public var shadowRadius:CGFloat = 50
// custom transform function
public var transform:((progress:CGFloat, view:UIView) -> Void)?
public var transform:((_ progress:CGFloat, _ view:UIView) -> Void)?
// Transform Type
public var transformType:ElasticTransitionBackgroundTransform = .translateMid{
@@ -416,7 +416,7 @@ public class ElasticTransition: EdgePanTransition, UIGestureRecognizerDelegate{
presentationController.shadowMaskLayer.dragPoint = presentationController.shadowMaskLayer.convert(cc.center, from: container.layer)
if transform != nil{
transform!(progress: progress, view: backView)
transform!(progress, backView)
}else{
// transform backView
switch transformType{
@@ -76,7 +76,7 @@ class InitialViewController: UIViewController {
present(modalViewController, animated: true, completion: nil)
}
override func prepare(for segue: UIStoryboardSegue, sender: AnyObject?) {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let vc = segue.destination
vc.transitioningDelegate = transition
vc.modalPresentationStyle = .custom
@@ -9,33 +9,33 @@
import UIKit
enum LeftMenuType{
case `switch`(name:String, on:Bool, onChange:(on:Bool)->Void)
case slider(name:String, value:Float, onChange:(value:Float)->Void)
case segment(name:String, values:[Any], selected:Int, onChange:(value:Any)->Void)
case `switch`(name:String, on:Bool, onChange:(_ on:Bool)->Void)
case slider(name:String, value:Float, onChange:(_ value:Float)->Void)
case segment(name:String, values:[Any], selected:Int, onChange:(_ value:Any)->Void)
}
class SwitchCell:UITableViewCell{
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var control: UISwitch!
var onChange:((on:Bool)->Void)?
var onChange:((_ on:Bool)->Void)?
@IBAction func switchChanged(_ sender: UISwitch) {
onChange?(on: sender.isOn)
onChange?(sender.isOn)
}
}
class SliderCell:UITableViewCell{
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var slider: UISlider!
var onChange:((value:Float)->Void)?
var onChange:((_ value:Float)->Void)?
@IBAction func sliderChanged(_ sender: UISlider) {
onChange?(value: sender.value)
onChange?(sender.value)
}
}
class SegmentCell:UITableViewCell{
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var segment: UISegmentedControl!
var values:[Any] = []
var onChange:((value:Any)->Void)?
var onChange:((_ value:Any)->Void)?
@IBAction func segmentChanged(_ sender: UISegmentedControl) {
onChange?(value: values[sender.selectedSegmentIndex])
View
@@ -1,3 +1,3 @@
platform :ios, "8.0"
use_frameworks!
pod "MotionAnimation", "~> 0.1.1"
pod "MotionAnimation", :git => 'https://github.com/lkzhao/MotionAnimation.git', :branch => 'swift3'
View
@@ -2,7 +2,18 @@ PODS:
- MotionAnimation (0.1.1)
DEPENDENCIES:
- MotionAnimation (~> 0.1.1)
- MotionAnimation (from `https://github.com/lkzhao/MotionAnimation.git`, branch
`swift3`)
EXTERNAL SOURCES:
MotionAnimation:
:branch: swift3
:git: https://github.com/lkzhao/MotionAnimation.git
CHECKOUT OPTIONS:
MotionAnimation:
:commit: f63e3f42c500f0bcb4568302d1a7bc2f342e45d7
:git: https://github.com/lkzhao/MotionAnimation.git
SPEC CHECKSUMS:
MotionAnimation: ff356cfdbedcab52a5bfc94cc96ed44ea2f652e0

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit a1a453d

Please sign in to comment.