Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 2.29 KB

README.md

File metadata and controls

62 lines (43 loc) · 2.29 KB

CI Status Version License Platform

SFCSBView

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

Example

// UIAppearance
[SFCSBView appearance].cornerRadius = 20;
[SFCSBView appearance].rectCornner = UIRectCornerAllCorners;
[SFCSBView appearance].shadowPosition = UIShadowPostionAll;
[SFCSBView appearance].shadowRadius = 20;
[SFCSBView appearance].borderColor = [UIColor systemBlueColor];
[SFCSBView appearance].borderWidth = 5;
[SFCSBView appearance].borderPosition = UIBorderPostionAll;


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'

Preview

Compare with CALayer

compare with CALayer

Random Cells

Review

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