Skip to content

Commit

Permalink
Merge pull request #46 from NickEntin/entin/remove-collection-keyframes
Browse files Browse the repository at this point in the history
Remove the collection keyframes feature
  • Loading branch information
NickEntin authored Sep 18, 2020
2 parents 1c86367 + b4563fd commit 7ac5f1b
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 464 deletions.
4 changes: 0 additions & 4 deletions Example/Stagehand.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
3D8E3D8222F17D3B00D70FCB /* AnimationCancelationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8E3D8122F17D3B00D70FCB /* AnimationCancelationViewController.swift */; };
3D8E3D8422F2BC9300D70FCB /* RepeatingAnimationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8E3D8322F2BC9300D70FCB /* RepeatingAnimationsViewController.swift */; };
3DA3997C230FCFAC00DE41A0 /* ExecutionBlockViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DA3997B230FCFAC00DE41A0 /* ExecutionBlockViewController.swift */; };
3DA5EB7C2318E64A001DF944 /* CollectionKeyframesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DA5EB7B2318E64A001DF944 /* CollectionKeyframesViewController.swift */; };
3DB3927D23249D680009E8B3 /* ColorAnimationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DB3927C23249D680009E8B3 /* ColorAnimationsViewController.swift */; };
3DBFEE422400B2460086D61C /* ChildAnimationProgressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBFEE412400B2460086D61C /* ChildAnimationProgressViewController.swift */; };
3DC75494232D82FD00402BD9 /* ChildAnimationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DC75492232D819700402BD9 /* ChildAnimationTests.swift */; };
Expand Down Expand Up @@ -103,7 +102,6 @@
3D8E3D8122F17D3B00D70FCB /* AnimationCancelationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimationCancelationViewController.swift; sourceTree = "<group>"; };
3D8E3D8322F2BC9300D70FCB /* RepeatingAnimationsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepeatingAnimationsViewController.swift; sourceTree = "<group>"; };
3DA3997B230FCFAC00DE41A0 /* ExecutionBlockViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExecutionBlockViewController.swift; sourceTree = "<group>"; };
3DA5EB7B2318E64A001DF944 /* CollectionKeyframesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionKeyframesViewController.swift; sourceTree = "<group>"; };
3DB3927C23249D680009E8B3 /* ColorAnimationsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorAnimationsViewController.swift; sourceTree = "<group>"; };
3DBFEE412400B2460086D61C /* ChildAnimationProgressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChildAnimationProgressViewController.swift; sourceTree = "<group>"; };
3DC75492232D819700402BD9 /* ChildAnimationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChildAnimationTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -200,7 +198,6 @@
3D8E3D8322F2BC9300D70FCB /* RepeatingAnimationsViewController.swift */,
3DA3997B230FCFAC00DE41A0 /* ExecutionBlockViewController.swift */,
3DEE4409231331DD0057D796 /* AnimationGroupViewController.swift */,
3DA5EB7B2318E64A001DF944 /* CollectionKeyframesViewController.swift */,
3D875EFF2323542500670803 /* PerformanceBenchmarkViewController.swift */,
3D2712ED236A17C5001D3B4B /* AnimationQueueViewController.swift */,
3D2C05902489F807003F5A4B /* CGAffineTransformDebuggingViewController.swift */,
Expand Down Expand Up @@ -601,7 +598,6 @@
607FACD81AFB9204008FA782 /* RootViewController.swift in Sources */,
B3C4CA092459F75800893CB5 /* ShapeLayerUtils.swift in Sources */,
3DBFEE422400B2460086D61C /* ChildAnimationProgressViewController.swift in Sources */,
3DA5EB7C2318E64A001DF944 /* CollectionKeyframesViewController.swift in Sources */,
3DA3997C230FCFAC00DE41A0 /* ExecutionBlockViewController.swift in Sources */,
3D2712EE236A17C5001D3B4B /* AnimationQueueViewController.swift in Sources */,
3D8E3D8222F17D3B00D70FCB /* AnimationCancelationViewController.swift in Sources */,
Expand Down
203 changes: 0 additions & 203 deletions Example/Stagehand/CollectionKeyframesViewController.swift

This file was deleted.

29 changes: 1 addition & 28 deletions Example/Stagehand/PerformanceBenchmarkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
// limitations under the License.
//

import Stagehand
import UIKit

// This file is testing the collection keyframes feature of Stagehand, which is not yet ready for release. Use a
// testable import here so we can call the internal methods.
@testable import Stagehand

final class PerformanceBenchmarkViewController: DemoViewController {

// MARK: - Life Cycle
Expand All @@ -35,30 +32,6 @@ final class PerformanceBenchmarkViewController: DemoViewController {
self.animationInstances.forEach { $0.cancel(behavior: .revert) }
self.animationInstances = []
}),
("Add Rotating Children Animation", { [unowned self] in
var animation = Animation<View>()
for degree in 0...360 {
animation.addKeyframe(
for: \.transform,
ofElementsIn: \.rotatingChildViews,
at: { index, count in
let adjustedByIndex = Double(degree) / 360 + Double(index) / Double(count)
return adjustedByIndex - floor(adjustedByIndex)
},
value: CGAffineTransform.identity
.translatedBy(
x: View.radius * cos(CGFloat(degree) * .pi / 180),
y: View.radius * sin(CGFloat(degree) * .pi / 180)
)
.rotated(by: CGFloat(degree) * .pi / 180)
)
}

animation.duration = 4
animation.repeatStyle = .infinitelyRepeating(autoreversing: false)

self.animationInstances.append(animation.perform(on: self.mainView))
}),
("Add Rotating Center View Animation", { [unowned self] in
var animation = Animation<View>()

Expand Down
1 change: 0 additions & 1 deletion Example/Stagehand/RootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ final class RootViewController: UITableViewController {
("Repeating Animations", { RepeatingAnimationsViewController() }),
("Execution Blocks", { ExecutionBlockViewController() }),
("Animation Groups", { AnimationGroupViewController() }),
("Collection Keyframes", { CollectionKeyframesViewController() }),
("Performance Benchmark", { PerformanceBenchmarkViewController() }),
("Animation Queues", { AnimationQueueViewController() }),
("CGAffineTransform Debugging", { CGAffineTransformDebuggingViewController() }),
Expand Down
2 changes: 0 additions & 2 deletions Sources/Stagehand/Animation/Animation+Optimization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ extension Animation {
// container for child animations.
guard
keyframeSeriesByProperty.isEmpty
&& collectionKeyframeSeriesByProperty.isEmpty
&& assignments.isEmpty
&& executionBlocks.isEmpty
&& perFrameExecutionBlocks.isEmpty
Expand Down Expand Up @@ -124,7 +123,6 @@ extension Animation {
private mutating func removeEmptyChildren() {
self.children = children.filter { child in
return !child.animation.keyframeSeriesByProperty.isEmpty
|| !child.animation.collectionKeyframeSeriesByProperty.isEmpty
|| !child.animation.assignments.isEmpty
|| !child.animation.executionBlocks.isEmpty
|| !child.animation.perFrameExecutionBlocks.isEmpty
Expand Down
Loading

0 comments on commit 7ac5f1b

Please sign in to comment.