Skip to content

Instantly share code, notes, and snippets.

View clarkeben's full-sized avatar
:octocat:
Working from home

Ben clarkeben

:octocat:
Working from home
View GitHub Profile
@clarkeben
clarkeben / UIKit-Animations.swift
Last active April 25, 2024 15:17
A list of simple yet effective animation extensions for UIKit
import UIKit
//MARK: - UIButton Animations
extension UIButton {
// Contract and retract animation
func contractRetractBtn(duration: Double) {
let contraction = CASpringAnimation(keyPath: "transform.scale")
contraction.duration = duration
contraction.fromValue = 0.96