Skip to content

Commit

Permalink
Minor fixes for v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gitroyalty-bot committed Feb 13, 2017
1 parent ea9fde5 commit 41b798f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Dance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ public class Dance {
///
/// - Parameters:
/// - duration: The total duration of the animations, measured in seconds. If you specify a negative value or 0, the changes are made without animating them.
/// - springiness: The damping ratio for the animation. From Apple: "The damping ratio for the spring animation as it approaches its quiescent state. To smoothly decelerate the animation without oscillation, use a value of 1. Employ a damping ratio closer to zero to increase oscillation."
/// - dampingRatio: The damping ratio for the spring animation as it approaches its quiescent state. To smoothly decelerate the animation without oscillation, use a value of 1. Employ a damping ratio closer to zero to increase oscillation.
/// - animation: Any changes to commit to the view during the animation (can be any property defined in Table 4-1 in https://developer.apple.com/library/content/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html)
@discardableResult public func animate(duration: TimeInterval, springiness: CGFloat, _ animation: @escaping (make) -> Void) -> Dance {
@discardableResult public func animate(duration: TimeInterval, dampingRatio: CGFloat, _ animation: @escaping (make) -> Void) -> Dance {

if self.hasAnimation {
DanceFactory.instance.finishAnimation(tag: dancingView.tag, at: .current)
Expand All @@ -366,7 +366,7 @@ public class Dance {
dancingView.tag = DanceFactory.instance.tagCount
DanceFactory.instance.tagCount += 1

DanceFactory.instance.createNewAnimator(tag: dancingView.tag, duration: duration, dampingRatio: springiness) {
DanceFactory.instance.createNewAnimator(tag: dancingView.tag, duration: duration, dampingRatio: dampingRatio) {
animation(self.dancingView)
}

Expand Down
2 changes: 2 additions & 0 deletions DanceExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = DanceExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = saoudrizwan.DanceExample;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -297,6 +298,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = DanceExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = saoudrizwan.DanceExample;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 2 additions & 0 deletions DanceExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
4 changes: 2 additions & 2 deletions DanceExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class ViewController: UIViewController {

/*
4) sping-based timing information
Basically, springiness should be a CGFloat between 0 and 1. The closer it is to 0, the 'springy-er' the animation will be. The closer it is to 1, the damper the spring animation will be.
Basically, dampingRatio should be a CGFloat between 0 and 1. The closer it is to 0, the 'springy-er' the animation will be. The closer it is to 1, the damper the spring animation will be.
*/

circle.dance.animate(duration: 10.0, springiness: 0.5) {
circle.dance.animate(duration: 10.0, dampingRatio: 0.5) {
$0.center = self.endPosition
}

Expand Down

0 comments on commit 41b798f

Please sign in to comment.