Skip to content

Instantly share code, notes, and snippets.

@wh1pch81n
Created December 7, 2016 19:02
Show Gist options
  • Save wh1pch81n/c07b5421a8aa77fa9f564d74261a554d to your computer and use it in GitHub Desktop.
Save wh1pch81n/c07b5421a8aa77fa9f564d74261a554d to your computer and use it in GitHub Desktop.
using Currying on UIView Animation
public class func animation(withDuration duration: TimeInterval) -> (@escaping () -> ()) -> (@escaping (Bool) -> ()) -> Void {
return { (animations: @escaping () -> ()) in
return { (completion: @escaping (Bool) -> ()) in
UIView.animate(withDuration: duration, animations: animations, completion: completion)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment