Skip to content

SilverFruity/UICornerShadowView

Repository files navigation

SFCSBView

iOS UIView Subclass: Use CoreGraphics to control the direction of Rect Corner、Shadow 、Border

Preview

Compare with CALayer

compare with CALayer

Random Cells

Review

Example

SFCSBView * shadowView = [SFCSBView new];
shadowView.cornerRadius = 20;
shadowView.rectCornner = UIRectCornerAllCorners;
shadowView.shadowPosition = UIShadowPostionAll;
shadowView.shadowColor = [[UIColor blackColor]colorWithAlphaComponent:0.6];
shadowView.shadowRadius = 20;
shadowView.borderColor = UIColor.systemBlueColor;
shadowView.borderWidth = 5;
shadowView.borderPosition = UIBorderPostionAll;

CocoaPods

pod 'SFImageMaker'

Performance

1000 shadow images only need 29MB and 1.01s

In this condition, maximum cpu occupancy rates is 45% and 60FPS when the count of cell is 1000 and quick slide,use iPhone 7, iOS13.3.1.

In extreme cases,no reuse, maximum cpu occupancy rates is 140% and 60FPS when the count of cell is 1000 and quick slide.

Review

About

iOS UIView Subclass: Use CoreGraphics to control the direction of Rect Corner、Shadow 、Border

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published