28 lines
634 B
Swift
28 lines
634 B
Swift
|
|
//
|
||
|
|
// ViewButtonAnimation.swift
|
||
|
|
// WOKA
|
||
|
|
//
|
||
|
|
// Created by Bilal on 24/05/2024.
|
||
|
|
//
|
||
|
|
|
||
|
|
import UIKit
|
||
|
|
|
||
|
|
class ViewButtonAnimation {
|
||
|
|
|
||
|
|
static let sharedInstance = ViewButtonAnimation()
|
||
|
|
|
||
|
|
private init() {}
|
||
|
|
|
||
|
|
@objc func btnTapped(in viewController: UIViewController, view: UIView ) {
|
||
|
|
// Apply click effect animation
|
||
|
|
UIView.animate(withDuration: 0.1, animations: {
|
||
|
|
view.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
|
||
|
|
}) { _ in
|
||
|
|
UIView.animate(withDuration: 0.1) {
|
||
|
|
view.transform = .identity
|
||
|
|
/*completionHandler*/()
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|