If we use KLSwitch views in UITableViewCells, scroll performance of table view degrades and becomes laggy.
The reason is that KLSwitch sets "cornerRadius" property, and this results in performance hit when drawing layers.
To solve this, we masksToBounds to yes on related layers, so that drawing system does not try to apply rounded masks to view. Also we set shouldRasterize property to YES to draw view as a bitmap and cache it. (Details can be found in the documentation.)
This setup gives back the tableview it's smooth scroll performance.
If we use KLSwitch views in UITableViewCells, scroll performance of table view degrades and becomes laggy.
The reason is that KLSwitch sets "cornerRadius" property, and this results in performance hit when drawing layers.
To solve this, we masksToBounds to yes on related layers, so that drawing system does not try to apply rounded masks to view. Also we set shouldRasterize property to YES to draw view as a bitmap and cache it. (Details can be found in the documentation.)
This setup gives back the tableview it's smooth scroll performance.