Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Commit

Permalink
Resolve Runtime v3 build warnings and remove reference to Runtime's d…
Browse files Browse the repository at this point in the history
…evelop branch.
  • Loading branch information
Jeff Verkoeyen committed Oct 3, 2016
1 parent 22a39c2 commit c69478d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
abstract_target 'MaterialMotionCoreAnimationFamily' do
pod 'MaterialMotionRuntime' , :git => 'https://github.com/material-motion/material-motion-runtime-objc.git', :branch => 'develop'
pod 'MaterialMotionRuntime'

pod 'MaterialMotionCoreAnimationFamily', :path => './'

Expand Down
12 changes: 2 additions & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,16 @@ PODS:

DEPENDENCIES:
- MaterialMotionCoreAnimationFamily (from `./`)
- MaterialMotionRuntime (from `https://github.com/material-motion/material-motion-runtime-objc.git`, branch `develop`)
- MaterialMotionRuntime

EXTERNAL SOURCES:
MaterialMotionCoreAnimationFamily:
:path: "./"
MaterialMotionRuntime:
:branch: develop
:git: https://github.com/material-motion/material-motion-runtime-objc.git

CHECKOUT OPTIONS:
MaterialMotionRuntime:
:commit: d7af3012df6a2e37ff2d2c1e7a43cb22b6e12a7f
:git: https://github.com/material-motion/material-motion-runtime-objc.git

SPEC CHECKSUMS:
MaterialMotionCoreAnimationFamily: b1510c270b916d14f2d4c40f8d065a2eb2ac7e7d
MaterialMotionRuntime: 056ed241097e4f63b7d25a34685d031703689a22

PODFILE CHECKSUM: 94030ee238c2efeb443b51e02663689c8f840c4f
PODFILE CHECKSUM: f3758cef32f3c3dffa982441bde398fb9dbbca2c

COCOAPODS: 1.1.0.rc.2
20 changes: 9 additions & 11 deletions src/CoreAnimationMotionFamily.swift → src/CAAnimationPlan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ extension CAAnimation: Plan {
}

/** A light-weight Core Animation Material Motion performer. */
@objc class CoreAnimationPerformer: NSObject, PlanPerforming, DelegatedPerforming {
class CoreAnimationPerformer: NSObject, PlanPerforming, ContinuousPerforming {
let target: CALayer
var willStart: DelegatedPerformanceTokenReturnBlock!
var didEnd: DelegatedPerformanceTokenArgBlock!

required init(target: Any) {
if let view = target as? UIView {
self.target = view.layer
Expand All @@ -43,21 +40,22 @@ extension CAAnimation: Plan {
}

func add(plan: Plan) {
let animation = plan as! CAAnimation

CATransaction.begin()

guard let token = self.willStart() else { return }
guard let token = tokenGenerator.generate() else { return }
CATransaction.setCompletionBlock {
self.didEnd(token)
token.terminate()
}

let animation = plan as! CAAnimation
self.target.add(animation, forKey: nil)
target.add(animation, forKey: nil)

CATransaction.commit()
}

func setDelegatedPerformance(willStart: @escaping DelegatedPerformanceTokenReturnBlock, didEnd: @escaping DelegatedPerformanceTokenArgBlock) {
self.willStart = willStart
self.didEnd = didEnd
var tokenGenerator: IsActiveTokenGenerating!
func set(isActiveTokenGenerator: IsActiveTokenGenerating) {
tokenGenerator = isActiveTokenGenerator
}
}

0 comments on commit c69478d

Please sign in to comment.