Skip to content

Instantly share code, notes, and snippets.

@danie7k
Created April 14, 2017 18:53
Show Gist options
  • Save danie7k/6f01ef09b0b5e44888268fb66b1e4fba to your computer and use it in GitHub Desktop.
Save danie7k/6f01ef09b0b5e44888268fb66b1e4fba to your computer and use it in GitHub Desktop.
func fixPerformance() {
if (self.cornerRadius > 0) {
self.masksToBounds = false
self.shouldRasterize = true
self.rasterizationScale = UIScreen.main.scale
}
if (self.shadowRadius > 0) {
self.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius: self.cornerRadius).cgPath
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment