Files

27 lines
611 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// UIView+AddShadow.swift
// PlusBank
//
// Created by Рустам Мотыгуллин on 08.05.2021.
//
import UIKit
extension UIView {
func addShadowFigma(blur: CGFloat, offset: CGSize, color: UIColor, bColor: UIColor = UIColor.background, radius: CGFloat, alpha: Float = 1.0) {
let layer = self.layer
layer.frame = bounds
layer.backgroundColor = bColor.cgColor
layer.shadowOpacity = alpha
layer.shadowColor = color.cgColor
layer.shadowOffset = offset
layer.shadowRadius = (blur / 2)
layer.cornerRadius = radius
layer.shouldRasterize = true
}
}