Commit 30051a07 by Daniel Dahan Committed by GitHub

Merge pull request #1102 from OrkhanAlikhanov/pr-1102

FABMenu delegation methods should only fire when triggered by user interaction
parents b90ee8ac caf6549a
...@@ -372,7 +372,7 @@ extension FABMenu { ...@@ -372,7 +372,7 @@ extension FABMenu {
- Parameter completion: A completion block to execute on each view's animation. - Parameter completion: A completion block to execute on each view's animation.
*/ */
open func open(isTriggeredByUserInteraction: Bool, duration: TimeInterval = 0.15, delay: TimeInterval = 0, usingSpringWithDamping: CGFloat = 0.5, initialSpringVelocity: CGFloat = 0, options: UIViewAnimationOptions = [], animations: ((UIView) -> Void)? = nil, completion: ((UIView) -> Void)? = nil) { open func open(isTriggeredByUserInteraction: Bool, duration: TimeInterval = 0.15, delay: TimeInterval = 0, usingSpringWithDamping: CGFloat = 0.5, initialSpringVelocity: CGFloat = 0, options: UIViewAnimationOptions = [], animations: ((UIView) -> Void)? = nil, completion: ((UIView) -> Void)? = nil) {
if delegate?.fabMenuShouldOpen?(fabMenu: self) == false { if isTriggeredByUserInteraction && delegate?.fabMenuShouldOpen?(fabMenu: self) == false {
return return
} }
...@@ -426,7 +426,7 @@ extension FABMenu { ...@@ -426,7 +426,7 @@ extension FABMenu {
*/ */
open func close(isTriggeredByUserInteraction: Bool, duration: TimeInterval = 0.15, delay: TimeInterval = 0, usingSpringWithDamping: CGFloat = 0.5, initialSpringVelocity: CGFloat = 0, options: UIViewAnimationOptions = [], animations: ((UIView) -> Void)? = nil, completion: ((UIView) -> Void)? = nil) { open func close(isTriggeredByUserInteraction: Bool, duration: TimeInterval = 0.15, delay: TimeInterval = 0, usingSpringWithDamping: CGFloat = 0.5, initialSpringVelocity: CGFloat = 0, options: UIViewAnimationOptions = [], animations: ((UIView) -> Void)? = nil, completion: ((UIView) -> Void)? = nil) {
if delegate?.fabMenuShouldClose?(fabMenu: self) == false { if isTriggeredByUserInteraction && delegate?.fabMenuShouldClose?(fabMenu: self) == false {
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment