Created by CyanHall.com
on 12/22/2020
, Last updated: 03/30/2021.
👉 Star me if it’s helpful. Reference:
UIView with rounded corners and drop shadow?
👉 Star me if it’s helpful.
//
// SDShadowView.swift
// Created by Cyanhall.com on 21/12/2020.
//
import UIKit
class SDShadowView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
self.setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)!
self.setup()
}
func setup() {
layer.cornerRadius = 5.0;
layer.masksToBounds = false
layer.shadowOffset = CGSize.init(width: 0, height: 3)
layer.shadowColor = UIColor.gray.cgColor
layer.shadowRadius = 3
layer.shadowOpacity = 0.4
}
}
More