Skip to content

Commit

Permalink
Fix #114
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamazz committed May 19, 2017
1 parent 3d24e25 commit 64d29a1
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions Source/PopTip+Transitions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ public extension PopTip {
UIView.animate(withDuration: animationIn, delay: delayIn, usingSpringWithDamping: 0.6, initialSpringVelocity: 1.5, options: [.curveEaseInOut, .beginFromCurrentState], animations: {
self.transform = .identity
self.backgroundMask?.alpha = 1
}) { (completed) in
if completed {
completion()
}
}) { (_) in
completion()
}
}

Expand All @@ -89,10 +87,8 @@ public extension PopTip {
UIView.animate(withDuration: animationIn, delay: delayIn, usingSpringWithDamping: 0.6, initialSpringVelocity: 1.5, options: [.curveEaseInOut, .beginFromCurrentState], animations: {
self.transform = .identity
self.backgroundMask?.alpha = 1
}) { (completed) in
if completed {
completion()
}
}) { (_) in
completion()
}
}

Expand All @@ -106,10 +102,8 @@ public extension PopTip {
UIView.animate(withDuration: animationIn, delay: delayIn, options: [.curveEaseInOut, .beginFromCurrentState], animations: {
self.alpha = 1
self.backgroundMask?.alpha = 1
}) { (completed) in
if completed {
completion()
}
}) { (_) in
completion()
}
}

Expand All @@ -119,10 +113,8 @@ public extension PopTip {
UIView.animate(withDuration: animationOut, delay: delayOut, options: [.curveEaseInOut, .beginFromCurrentState], animations: {
self.transform = CGAffineTransform(scaleX: 0.0001, y: 0.0001)
self.backgroundMask?.alpha = 0
}) { (completed) in
if completed {
completion()
}
}) { (_) in
completion()
}
}

Expand All @@ -132,10 +124,8 @@ public extension PopTip {
UIView.animate(withDuration: animationOut, delay: delayOut, options: [.curveEaseInOut, .beginFromCurrentState], animations: {
self.alpha = 0
self.backgroundMask?.alpha = 0
}) { (completed) in
if completed {
completion()
}
}) { (_) in
completion()
}
}
}

0 comments on commit 64d29a1

Please sign in to comment.