how to make box shadow swift
extension UIView {
func dropShadow(color: UIColor, opacity: Float = 0.5, offSet: CGSize, radius: CGFloat = 1, scale: Bool = true) {
layer.masksToBounds = false
layer.shadowColor = color.cgColor
layer.shadowOpacity = opacity
layer.shadowOffset = offSet
layer.shadowRadius = radius
layer.shadowPath = UIBezierPath(rect: self.bounds).cgPath
layer.shouldRasterize = true
layer.rasterizationScale = scale ? UIScreen.main.scale : 1
}
}
Also in Swift:
- localized string format swift
- remove back button swift
- run a function only once swift
- how to add two right bar button item xcode
- ios rounded button
- pop the view controller xcode
- uilabel font size swift
- Link swiftui
- convert string to int swift
- context.fetch() in swift
- receive notificationcenter data in swift
- swift retrieve value from dictionary
- swift temporary directory
- swift file size from url
- swift - salesforce chat only
- create alert in swift
- remove all add TapGestureRecognizer swift
- how to screen record swift stackoverflow
- swift convert dictionary to json
- swift pass function as parameter
- swift bring something to front of view
- swift generate uuid
- xcode disable a button
- convert secondsfrom1970 to date swift