Perf: remove unnecessary shadows and mask views
This commit is contained in:
@@ -65,6 +65,8 @@ class ReliefButton: UIButton
|
||||
backgroundView.layer.masksToBounds = true
|
||||
backgroundView.layer.borderWidth = Self.borderWidth
|
||||
backgroundView.layer.cornerCurve = .continuous
|
||||
backgroundView.layer.shouldRasterize = true
|
||||
backgroundView.layer.rasterizationScale = UIScreen.main.scale
|
||||
addSubview(backgroundView)
|
||||
|
||||
traitCollectionDidChange(nil)
|
||||
@@ -151,5 +153,8 @@ class ReliefButton: UIButton
|
||||
}
|
||||
|
||||
shadowView.frame = backgroundView.frame
|
||||
|
||||
let shadowPath = UIBezierPath(roundedRect: shadowView.bounds, cornerRadius: Self.cornerRadius)
|
||||
shadowView.layer.shadowPath = shadowPath.cgPath
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user