Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

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
  }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: Swift Properties 
Swift :: swift test if simulator 
Swift :: swift doc comments 
Swift :: foreach swiftui object 
Swift :: replace character in swift 
Swift :: textchange in textview swift 
Swift :: swift do while 
Swift :: swift core data sort by date 
Swift :: and in swift1 
Swift :: show back button in navbar swift 
Swift :: get address from latitude and longitude in swift 
Swift :: change font of substring swift 
Swift :: custom tab bar swift ios 
Swift :: swift arrays 
Swift :: standard bank swift code 
Swift :: Swift Closure That Returns Value 
Swift :: swift infinite while loop 
Swift :: swift 5 to upper 
Swift :: ios UIButton change image 
Swift :: swift extension Array with specific element type 
Swift :: swiftui hidden 
Swift :: add arc swiftui 
Swift :: check if UIView is UIButton or UILabel not 
Swift :: swift how to wait in a loop 
Swift :: free robux codes 
Swift :: swift output 
Swift :: get character at specifiic location swift 
Swift :: Swift Nested Tuple 
Swift :: swift how to append an element 
Swift :: AndroidManifest.xml:5: Error: Class referenced in the manifest flutter build 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =