2024-05-24 19:26:54 +05:30
|
|
|
//
|
|
|
|
|
// ViewButtonAnimation.swift
|
|
|
|
|
// WOKA
|
|
|
|
|
//
|
|
|
|
|
// Created by Bilal on 24/05/2024.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
|
|
class ViewButtonAnimation {
|
|
|
|
|
|
|
|
|
|
static let sharedInstance = ViewButtonAnimation()
|
|
|
|
|
|
|
|
|
|
private init() {}
|
|
|
|
|
|
2024-05-27 19:42:56 +05:30
|
|
|
@objc func btnTapped(in viewController: UIViewController, view: UIView, completionHandler : @escaping () -> Void) {
|
2024-05-24 19:26:54 +05:30
|
|
|
// 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
|
2024-05-27 19:42:56 +05:30
|
|
|
completionHandler()
|
2024-05-24 19:26:54 +05:30
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-06 20:50:25 +05:30
|
|
|
|
|
|
|
|
@objc func cellTapped(view: UIView, completionHandler : @escaping () -> Void) {
|
|
|
|
|
// Apply click effect animation
|
|
|
|
|
UIView.animate(withDuration: 0.05, animations: {
|
|
|
|
|
view.transform = CGAffineTransform(scaleX: 0.95, y: 0.95)
|
|
|
|
|
}) { _ in
|
|
|
|
|
UIView.animate(withDuration: 0.05) {
|
|
|
|
|
view.transform = .identity
|
|
|
|
|
completionHandler()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-24 19:26:54 +05:30
|
|
|
}
|